mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user