pull/2339/head
kunfei 2 years ago
parent fd92b424c7
commit 20f4d8c222
  1. 9
      app/src/main/java/io/legado/app/ui/about/AboutFragment.kt

@ -58,14 +58,14 @@ class AboutFragment : PreferenceFragmentCompat() {
override fun onPreferenceTreeClick(preference: Preference): Boolean { override fun onPreferenceTreeClick(preference: Preference): Boolean {
when (preference.key) { when (preference.key) {
"contributors" -> openUrl(R.string.contributors_url) "contributors" -> openUrl(R.string.contributors_url)
"update_log" -> show("updateLog.md") "update_log" -> showMdFile("updateLog.md")
"check_update" -> checkUpdate() "check_update" -> checkUpdate()
"mail" -> requireContext().sendMail(getString(R.string.email)) "mail" -> requireContext().sendMail(getString(R.string.email))
"sourceRuleSummary" -> openUrl(R.string.source_rule_url) "sourceRuleSummary" -> openUrl(R.string.source_rule_url)
"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" -> openUrl(R.string.license_url) "license" -> openUrl(R.string.license_url)
"disclaimer" -> show("disclaimer.md") "disclaimer" -> showMdFile("disclaimer.md")
"qq" -> showQqGroups() "qq" -> showQqGroups()
"gzGzh" -> requireContext().sendToClip(getString(R.string.legado_gzh)) "gzGzh" -> requireContext().sendToClip(getString(R.string.legado_gzh))
"crashLog" -> showCrashLogs() "crashLog" -> showCrashLogs()
@ -81,7 +81,10 @@ class AboutFragment : PreferenceFragmentCompat() {
requireContext().openUrl(getString(addressID)) requireContext().openUrl(getString(addressID))
} }
private fun show(FileName: String) { /**
* 显示md文件
*/
private fun showMdFile(FileName: String) {
val mdText = String(requireContext().assets.open(FileName).readBytes()) val mdText = String(requireContext().assets.open(FileName).readBytes())
showDialogFragment(TextDialog(mdText, TextDialog.Mode.MD)) showDialogFragment(TextDialog(mdText, TextDialog.Mode.MD))
} }

Loading…
Cancel
Save