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 {