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())