免责声明使用本地文件

This commit is contained in:
Xwite 2022-01-22 19:24:08 +08:00
parent bec4afe309
commit b3a7effe7b

View File

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