From 816ea32cf372426acaa7df6bbe2e2bc04797f474 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 5 Jul 2020 18:43:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97,=E4=BB=8E=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E8=8F=9C=E5=8D=95=E6=B5=8F=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/download/DownloadActivity.kt | 2 +- .../java/io/legado/app/ui/widget/dialog/TextListDialog.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/download/DownloadActivity.kt b/app/src/main/java/io/legado/app/ui/book/download/DownloadActivity.kt index 8e049a369..0d3de4895 100644 --- a/app/src/main/java/io/legado/app/ui/book/download/DownloadActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/download/DownloadActivity.kt @@ -93,7 +93,7 @@ class DownloadActivity : VMBaseActivity(R.layout.activity_dow } } R.id.menu_log -> { - TextListDialog.show(supportFragmentManager, Download.logs) + TextListDialog.show(supportFragmentManager, getString(R.string.log), Download.logs) } R.id.menu_no_group -> { title_bar.subtitle = getString(R.string.no_group) diff --git a/app/src/main/java/io/legado/app/ui/widget/dialog/TextListDialog.kt b/app/src/main/java/io/legado/app/ui/widget/dialog/TextListDialog.kt index ca8e9d6a4..323e622ea 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dialog/TextListDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/dialog/TextListDialog.kt @@ -18,9 +18,10 @@ import kotlinx.android.synthetic.main.item_log.view.* class TextListDialog : BaseDialogFragment() { companion object { - fun show(fragmentManager: FragmentManager, values: ArrayList) { + fun show(fragmentManager: FragmentManager, title: String, values: ArrayList) { TextListDialog().apply { val bundle = Bundle() + bundle.putString("title", title) bundle.putStringArrayList("values", values) arguments = bundle }.show(fragmentManager, "textListDialog") @@ -46,8 +47,8 @@ class TextListDialog : BaseDialogFragment() { } override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { - tool_bar.title = getString(R.string.log) arguments?.let { + tool_bar.title = it.getString("title") values = it.getStringArrayList("values") } recycler_view.layoutManager = LinearLayoutManager(requireContext())