pull/1879/head
kunfei 3 years ago
parent 4a17a40378
commit 2aee68f5a2
  1. 5
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt
  2. 4
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  3. 4
      app/src/main/java/io/legado/app/ui/widget/checkbox/SmoothCheckBox.kt

@ -6,6 +6,7 @@ import android.content.SharedPreferences
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.core.view.postDelayed
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
import androidx.preference.ListPreference import androidx.preference.ListPreference
import androidx.preference.Preference import androidx.preference.Preference
@ -131,9 +132,9 @@ class OtherConfigFragment : PreferenceFragment(),
setProcessTextEnable(it.getBoolean(key, true)) setProcessTextEnable(it.getBoolean(key, true))
} }
PreferKey.showDiscovery, PreferKey.showRss -> postEvent(EventBus.NOTIFY_MAIN, true) PreferKey.showDiscovery, PreferKey.showRss -> postEvent(EventBus.NOTIFY_MAIN, true)
PreferKey.language -> listView.postDelayed({ PreferKey.language -> listView.postDelayed(1000) {
appCtx.restart() appCtx.restart()
}, 1000) }
PreferKey.userAgent -> listView.post { PreferKey.userAgent -> listView.post {
upPreferenceSummary(PreferKey.userAgent, AppConfig.userAgent) upPreferenceSummary(PreferKey.userAgent, AppConfig.userAgent)
} }

@ -92,9 +92,9 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
viewModel.upAllBookToc() viewModel.upAllBookToc()
} }
} }
binding.viewPagerMain.postDelayed({ binding.viewPagerMain.postDelayed(3000) {
viewModel.postLoad() viewModel.postLoad()
}, 3000) }
launch { launch {
val lastBackupFile = withContext(IO) { AppWebDav.lastBackUp().getOrNull() } val lastBackupFile = withContext(IO) { AppWebDav.lastBackUp().getOrNull() }
?: return@launch ?: return@launch

@ -299,10 +299,10 @@ class SmoothCheckBox @JvmOverloads constructor(
} }
private fun drawTickDelayed() { private fun drawTickDelayed() {
postDelayed({ postDelayed(mAnimDuration.toLong()) {
mTickDrawing = true mTickDrawing = true
postInvalidate() postInvalidate()
}, mAnimDuration.toLong()) }
} }
companion object { companion object {

Loading…
Cancel
Save