From b3a7effe7b4d7e8cc212e2355ca81042a0c25f4d Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Sat, 22 Jan 2022 19:24:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=8D=E8=B4=A3=E5=A3=B0=E6=98=8E=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=9C=AC=E5=9C=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/ui/about/AboutFragment.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt index a88986385..18626bc06 100644 --- a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt +++ b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt @@ -20,7 +20,6 @@ import io.legado.app.utils.* class AboutFragment : PreferenceFragmentCompat() { private val licenseUrl = "https://github.com/gedoor/legado/blob/master/LICENSE" - private val disclaimerUrl = "https://gedoor.github.io/MyBookshelf/disclaimer.html" private val qqGroups = linkedMapOf( Pair("(QQ群1)805192012", "6GlFKjLeIk5RhQnR3PNVDaKB6j10royo"), Pair("(QQ群2)773736122", "5Bm5w6OgLupXnICbYvbgzpPUgf0UlsJF"), @@ -58,7 +57,7 @@ class AboutFragment : PreferenceFragmentCompat() { "git" -> openUrl(R.string.this_github_url) "home_page" -> openUrl(R.string.home_page_url) "license" -> requireContext().openUrl(licenseUrl) - "disclaimer" -> requireContext().openUrl(disclaimerUrl) + "disclaimer" -> showDisclaimer() "qq" -> showQqGroups() "gzGzh" -> requireContext().sendToClip(getString(R.string.legado_gzh)) "crashLog" -> showCrashLogs() @@ -78,6 +77,11 @@ class AboutFragment : PreferenceFragmentCompat() { showDialogFragment(TextDialog(log, TextDialog.Mode.MD)) } + private fun showDisclaimer() { + val disclaimer = String(requireContext().assets.open("disclaimer.md").readBytes()) + showDialogFragment(TextDialog(disclaimer, TextDialog.Mode.MD)) + } + private fun checkUpdate() { AppUpdate.checkFromGitHub(lifecycleScope) { newVersion, updateBody, url, name -> showDialogFragment(