diff --git a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt index 7dcecaf11..f3087f5e7 100644 --- a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt @@ -24,6 +24,7 @@ import io.legado.app.ui.config.ConfigActivity import io.legado.app.ui.config.ConfigViewModel import io.legado.app.ui.filechooser.FileChooserDialog import io.legado.app.ui.replacerule.ReplaceRuleActivity +import io.legado.app.ui.widget.dialog.TextDialog import io.legado.app.ui.widget.prefs.NameListPreference import io.legado.app.ui.widget.prefs.PreferenceCategory import io.legado.app.ui.widget.prefs.SwitchPreference @@ -48,9 +49,10 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog. override fun onCompatOptionsItemSelected(item: MenuItem) { when (item.itemId) { - R.id.menu_help -> startActivity() - R.id.menu_backup -> BackupRestoreUi.backup(this) - R.id.menu_restore -> BackupRestoreUi.restore(this) + R.id.menu_help -> { + val text = String(requireContext().assets.open("help.md").readBytes()) + TextDialog.show(childFragmentManager, text, TextDialog.MD) + } } } diff --git a/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt b/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt index 648949abd..9c1c75d5e 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt @@ -77,10 +77,16 @@ class TextDialog : BaseDialogFragment() { time -= 1000 badge_view.setBadgeCount((time / 1000).toInt()) if (time <= 0) { - dialog?.setCancelable(true) + view.post { + dialog?.setCancelable(true) + } } } } + } else { + view.post { + dialog?.setCancelable(true) + } } } diff --git a/app/src/main/res/menu/main_my.xml b/app/src/main/res/menu/main_my.xml index db1161c28..74e555dff 100644 --- a/app/src/main/res/menu/main_my.xml +++ b/app/src/main/res/menu/main_my.xml @@ -10,16 +10,4 @@ app:showAsAction="always" tools:ignore="AlwaysShowAction" /> - - - -