免责声明使用本地文件

pull/1551/head
Xwite 3 years ago
parent bec4afe309
commit b3a7effe7b
  1. 8
      app/src/main/java/io/legado/app/ui/about/AboutFragment.kt

@ -20,7 +20,6 @@ import io.legado.app.utils.*
class AboutFragment : PreferenceFragmentCompat() { class AboutFragment : PreferenceFragmentCompat() {
private val licenseUrl = "https://github.com/gedoor/legado/blob/master/LICENSE" 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( private val qqGroups = linkedMapOf(
Pair("(QQ群1)805192012", "6GlFKjLeIk5RhQnR3PNVDaKB6j10royo"), Pair("(QQ群1)805192012", "6GlFKjLeIk5RhQnR3PNVDaKB6j10royo"),
Pair("(QQ群2)773736122", "5Bm5w6OgLupXnICbYvbgzpPUgf0UlsJF"), Pair("(QQ群2)773736122", "5Bm5w6OgLupXnICbYvbgzpPUgf0UlsJF"),
@ -58,7 +57,7 @@ class AboutFragment : PreferenceFragmentCompat() {
"git" -> openUrl(R.string.this_github_url) "git" -> openUrl(R.string.this_github_url)
"home_page" -> openUrl(R.string.home_page_url) "home_page" -> openUrl(R.string.home_page_url)
"license" -> requireContext().openUrl(licenseUrl) "license" -> requireContext().openUrl(licenseUrl)
"disclaimer" -> requireContext().openUrl(disclaimerUrl) "disclaimer" -> showDisclaimer()
"qq" -> showQqGroups() "qq" -> showQqGroups()
"gzGzh" -> requireContext().sendToClip(getString(R.string.legado_gzh)) "gzGzh" -> requireContext().sendToClip(getString(R.string.legado_gzh))
"crashLog" -> showCrashLogs() "crashLog" -> showCrashLogs()
@ -78,6 +77,11 @@ class AboutFragment : PreferenceFragmentCompat() {
showDialogFragment(TextDialog(log, TextDialog.Mode.MD)) 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() { private fun checkUpdate() {
AppUpdate.checkFromGitHub(lifecycleScope) { newVersion, updateBody, url, name -> AppUpdate.checkFromGitHub(lifecycleScope) { newVersion, updateBody, url, name ->
showDialogFragment( showDialogFragment(

Loading…
Cancel
Save