|
|
@ -19,8 +19,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 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"), |
|
|
@ -51,14 +49,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" -> showUpdateLog() |
|
|
|
"update_log" -> show("updateLog.md") |
|
|
|
"check_update" -> checkUpdate() |
|
|
|
"check_update" -> checkUpdate() |
|
|
|
"mail" -> requireContext().sendMail("kunfei.ge@gmail.com") |
|
|
|
"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" -> requireContext().openUrl(licenseUrl) |
|
|
|
"license" -> openUrl(R.string.license_url) |
|
|
|
"disclaimer" -> requireContext().openUrl(disclaimerUrl) |
|
|
|
"disclaimer" -> show("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() |
|
|
@ -73,9 +71,9 @@ class AboutFragment : PreferenceFragmentCompat() { |
|
|
|
requireContext().openUrl(getString(addressID)) |
|
|
|
requireContext().openUrl(getString(addressID)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun showUpdateLog() { |
|
|
|
private fun show(FileName: String) { |
|
|
|
val log = String(requireContext().assets.open("updateLog.md").readBytes()) |
|
|
|
val mdText = String(requireContext().assets.open(FileName).readBytes()) |
|
|
|
showDialogFragment(TextDialog(log, TextDialog.Mode.MD)) |
|
|
|
showDialogFragment(TextDialog(mdText, TextDialog.Mode.MD)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun checkUpdate() { |
|
|
|
private fun checkUpdate() { |
|
|
|