fix batch add log

(cherry picked from commit 629bca4100243d61cf07bbb0f47f6a1ed84031cb)
This commit is contained in:
Rani Sargees 2020-07-12 15:13:17 -04:00 committed by Jobobby04
parent e1fd0d1a4a
commit a839372d9f

View File

@ -49,12 +49,14 @@ class BatchAddController : NucleusController<EhFragmentBatchAddBinding, BatchAdd
val progressSubscriptions = CompositeSubscription()
presenter.currentlyAddingRelay
.onBackpressureBuffer()
.observeOn(AndroidSchedulers.mainThread())
.subscribeUntilDestroy {
progressSubscriptions.clear()
if (it == BatchAddPresenter.STATE_INPUT_TO_PROGRESS) {
showProgress(this)
progressSubscriptions += presenter.progressRelay
.onBackpressureBuffer()
.observeOn(AndroidSchedulers.mainThread())
.combineLatest(presenter.progressTotalRelay) { progress, total ->
// Show hide dismiss button
@ -71,18 +73,21 @@ class BatchAddController : NucleusController<EhFragmentBatchAddBinding, BatchAdd
}
progressSubscriptions += presenter.progressTotalRelay
.onBackpressureBuffer()
.observeOn(AndroidSchedulers.mainThread())
.subscribeUntilDestroy {
binding.progressBar.max = it
}
progressSubscriptions += presenter.progressRelay
.onBackpressureBuffer()
.observeOn(AndroidSchedulers.mainThread())
.subscribeUntilDestroy {
binding.progressBar.progress = it
}
presenter.eventRelay
?.onBackpressureBuffer()
?.observeOn(AndroidSchedulers.mainThread())
?.subscribeUntilDestroy {
binding.progressLog.append("$it\n")