pull/2339/head
kunfei 2 years ago
parent 242452c3a5
commit fd92b424c7
  1. 8
      app/src/main/java/io/legado/app/ui/about/AboutFragment.kt

@ -15,6 +15,7 @@ import io.legado.app.help.config.AppConfig
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.selector
import io.legado.app.ui.widget.dialog.TextDialog
import io.legado.app.ui.widget.dialog.WaitDialog
import io.legado.app.utils.*
import splitties.init.appCtx
@ -36,6 +37,10 @@ class AboutFragment : PreferenceFragmentCompat() {
private val qqChannel =
"https://qun.qq.com/qqweb/qunpro/share?_wv=3&_wwv=128&inviteCode=25d870&from=246610&biz=ka"
private val waitDialog by lazy {
WaitDialog(requireContext())
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.about)
findPreference<Preference>("update_log")?.summary =
@ -85,6 +90,7 @@ class AboutFragment : PreferenceFragmentCompat() {
* 检测更新
*/
private fun checkUpdate() {
waitDialog.show()
AppUpdate.checkFromGitHub(lifecycleScope)
.onSuccess {
showDialogFragment(
@ -92,6 +98,8 @@ class AboutFragment : PreferenceFragmentCompat() {
)
}.onError {
appCtx.toastOnUi("${getString(R.string.check_update)}\n${it.localizedMessage}")
}.onFinally {
waitDialog.hide()
}
}

Loading…
Cancel
Save