From 2aee68f5a2733214b3b489fe5502fe2c1240700e Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 13 May 2022 11:23:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/config/OtherConfigFragment.kt | 5 +++-- app/src/main/java/io/legado/app/ui/main/MainActivity.kt | 4 ++-- .../java/io/legado/app/ui/widget/checkbox/SmoothCheckBox.kt | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt index f1ec03bce..5ffdede56 100644 --- a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt @@ -6,6 +6,7 @@ import android.content.SharedPreferences import android.content.pm.PackageManager import android.os.Bundle import android.view.View +import androidx.core.view.postDelayed import androidx.fragment.app.activityViewModels import androidx.preference.ListPreference import androidx.preference.Preference @@ -131,9 +132,9 @@ class OtherConfigFragment : PreferenceFragment(), setProcessTextEnable(it.getBoolean(key, true)) } PreferKey.showDiscovery, PreferKey.showRss -> postEvent(EventBus.NOTIFY_MAIN, true) - PreferKey.language -> listView.postDelayed({ + PreferKey.language -> listView.postDelayed(1000) { appCtx.restart() - }, 1000) + } PreferKey.userAgent -> listView.post { upPreferenceSummary(PreferKey.userAgent, AppConfig.userAgent) } diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index ef8e2d89a..cba86573f 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -92,9 +92,9 @@ class MainActivity : VMBaseActivity(), viewModel.upAllBookToc() } } - binding.viewPagerMain.postDelayed({ + binding.viewPagerMain.postDelayed(3000) { viewModel.postLoad() - }, 3000) + } launch { val lastBackupFile = withContext(IO) { AppWebDav.lastBackUp().getOrNull() } ?: return@launch diff --git a/app/src/main/java/io/legado/app/ui/widget/checkbox/SmoothCheckBox.kt b/app/src/main/java/io/legado/app/ui/widget/checkbox/SmoothCheckBox.kt index cbc761510..7afa0e27a 100644 --- a/app/src/main/java/io/legado/app/ui/widget/checkbox/SmoothCheckBox.kt +++ b/app/src/main/java/io/legado/app/ui/widget/checkbox/SmoothCheckBox.kt @@ -299,10 +299,10 @@ class SmoothCheckBox @JvmOverloads constructor( } private fun drawTickDelayed() { - postDelayed({ + postDelayed(mAnimDuration.toLong()) { mTickDrawing = true postInvalidate() - }, mAnimDuration.toLong()) + } } companion object {