feat: 添加下载错误日志,从下载菜单浏览

pull/274/head
gedoor 4 years ago
parent 57dd30ee69
commit 816ea32cf3
  1. 2
      app/src/main/java/io/legado/app/ui/book/download/DownloadActivity.kt
  2. 5
      app/src/main/java/io/legado/app/ui/widget/dialog/TextListDialog.kt

@ -93,7 +93,7 @@ class DownloadActivity : VMBaseActivity<DownloadViewModel>(R.layout.activity_dow
} }
} }
R.id.menu_log -> { R.id.menu_log -> {
TextListDialog.show(supportFragmentManager, Download.logs) TextListDialog.show(supportFragmentManager, getString(R.string.log), Download.logs)
} }
R.id.menu_no_group -> { R.id.menu_no_group -> {
title_bar.subtitle = getString(R.string.no_group) title_bar.subtitle = getString(R.string.no_group)

@ -18,9 +18,10 @@ import kotlinx.android.synthetic.main.item_log.view.*
class TextListDialog : BaseDialogFragment() { class TextListDialog : BaseDialogFragment() {
companion object { companion object {
fun show(fragmentManager: FragmentManager, values: ArrayList<String>) { fun show(fragmentManager: FragmentManager, title: String, values: ArrayList<String>) {
TextListDialog().apply { TextListDialog().apply {
val bundle = Bundle() val bundle = Bundle()
bundle.putString("title", title)
bundle.putStringArrayList("values", values) bundle.putStringArrayList("values", values)
arguments = bundle arguments = bundle
}.show(fragmentManager, "textListDialog") }.show(fragmentManager, "textListDialog")
@ -46,8 +47,8 @@ class TextListDialog : BaseDialogFragment() {
} }
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
tool_bar.title = getString(R.string.log)
arguments?.let { arguments?.let {
tool_bar.title = it.getString("title")
values = it.getStringArrayList("values") values = it.getStringArrayList("values")
} }
recycler_view.layoutManager = LinearLayoutManager(requireContext()) recycler_view.layoutManager = LinearLayoutManager(requireContext())

Loading…
Cancel
Save