Migrate more preferences

(cherry picked from commit 53a3be0703)
This commit is contained in:
Jobobby04
2020-05-01 22:16:04 -04:00
parent e97d1ac257
commit 24850450cb
5 changed files with 13 additions and 9 deletions
@@ -8,10 +8,10 @@ import com.afollestad.materialdialogs.MaterialDialog
import eu.kanade.tachiyomi.databinding.EhFragmentBatchAddBinding
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
import eu.kanade.tachiyomi.util.lang.combineLatest
import eu.kanade.tachiyomi.util.lang.launchInUI
import eu.kanade.tachiyomi.util.lang.plusAssign
import kotlinx.android.synthetic.main.eh_fragment_batch_add.view.galleries_box
import kotlinx.android.synthetic.main.eh_fragment_batch_add.view.progress_log
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import reactivecircus.flowbinding.android.view.clicks
import rx.android.schedulers.AndroidSchedulers
@@ -38,13 +38,13 @@ class BatchAddController : NucleusController<EhFragmentBatchAddBinding, BatchAdd
.onEach {
addGalleries(binding.galleriesBox.text.toString())
}
.launchInUI()
.launchIn(scope)
binding.progressDismissBtn.clicks()
.onEach {
presenter.currentlyAddingRelay.call(BatchAddPresenter.STATE_PROGRESS_TO_INPUT)
}
.launchInUI()
.launchIn(scope)
val progressSubscriptions = CompositeSubscription()
@@ -6,7 +6,9 @@ import com.bluelinelabs.conductor.Router
import com.bluelinelabs.conductor.RouterTransaction
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.preference.getOrDefault
import eu.kanade.tachiyomi.util.lang.launchInUI
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import uy.kohesive.injekt.injectLazy
@@ -15,6 +17,8 @@ object LockActivityDelegate {
var willLock: Boolean = true
private val uiScope = CoroutineScope(Dispatchers.Main)
fun doLock(router: Router, animate: Boolean = false) {
router.pushController(RouterTransaction.with(LockController())
.popChangeHandler(LockChangeHandler(animate)))
@@ -29,7 +33,7 @@ object LockActivityDelegate {
activity.window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
}
}
.launchInUI()
.launchIn(uiScope)
}
fun onResume(activity: FragmentActivity, router: Router) {