Linting Fixes AZ

This commit is contained in:
Jobobby04
2020-05-02 00:46:24 -04:00
parent 03e5c5ca10
commit 7e99a9f789
108 changed files with 2962 additions and 2412 deletions
@@ -49,66 +49,68 @@ class BatchAddController : NucleusController<EhFragmentBatchAddBinding, BatchAdd
val progressSubscriptions = CompositeSubscription()
presenter.currentlyAddingRelay
.observeOn(AndroidSchedulers.mainThread())
.subscribeUntilDestroy {
progressSubscriptions.clear()
if (it == BatchAddPresenter.STATE_INPUT_TO_PROGRESS) {
showProgress(this)
progressSubscriptions += presenter.progressRelay
.observeOn(AndroidSchedulers.mainThread())
.combineLatest(presenter.progressTotalRelay) { progress, total ->
// Show hide dismiss button
binding.progressDismissBtn.visibility =
if (progress == total)
View.VISIBLE
else View.GONE
.observeOn(AndroidSchedulers.mainThread())
.subscribeUntilDestroy {
progressSubscriptions.clear()
if (it == BatchAddPresenter.STATE_INPUT_TO_PROGRESS) {
showProgress(this)
progressSubscriptions += presenter.progressRelay
.observeOn(AndroidSchedulers.mainThread())
.combineLatest(presenter.progressTotalRelay) { progress, total ->
// Show hide dismiss button
binding.progressDismissBtn.visibility =
if (progress == total) {
View.VISIBLE
} else {
View.GONE
}
formatProgress(progress, total)
}.subscribeUntilDestroy {
formatProgress(progress, total)
}.subscribeUntilDestroy {
binding.progressText.text = it
}
progressSubscriptions += presenter.progressTotalRelay
.observeOn(AndroidSchedulers.mainThread())
.subscribeUntilDestroy {
binding.progressBar.max = it
}
progressSubscriptions += presenter.progressRelay
.observeOn(AndroidSchedulers.mainThread())
.subscribeUntilDestroy {
binding.progressBar.progress = it
}
presenter.eventRelay
?.observeOn(AndroidSchedulers.mainThread())
?.subscribeUntilDestroy {
binding.progressLog.append("$it\n")
}?.let {
progressSubscriptions += it
progressSubscriptions += presenter.progressTotalRelay
.observeOn(AndroidSchedulers.mainThread())
.subscribeUntilDestroy {
binding.progressBar.max = it
}
} else if (it == BatchAddPresenter.STATE_PROGRESS_TO_INPUT) {
hideProgress(this)
presenter.currentlyAddingRelay.call(BatchAddPresenter.STATE_IDLE)
progressSubscriptions += presenter.progressRelay
.observeOn(AndroidSchedulers.mainThread())
.subscribeUntilDestroy {
binding.progressBar.progress = it
}
presenter.eventRelay
?.observeOn(AndroidSchedulers.mainThread())
?.subscribeUntilDestroy {
binding.progressLog.append("$it\n")
}?.let {
progressSubscriptions += it
}
} else if (it == BatchAddPresenter.STATE_PROGRESS_TO_INPUT) {
hideProgress(this)
presenter.currentlyAddingRelay.call(BatchAddPresenter.STATE_IDLE)
}
}
}
}
private val View.progressViews
get() = listOf(
binding.progressTitleView,
binding.progressLogWrapper,
binding.progressBar,
binding.progressText,
binding.progressDismissBtn
binding.progressTitleView,
binding.progressLogWrapper,
binding.progressBar,
binding.progressText,
binding.progressDismissBtn
)
private val View.inputViews
get() = listOf(
binding.inputTitleView,
binding.galleriesBox,
binding.btnAddGalleries
binding.inputTitleView,
binding.galleriesBox,
binding.btnAddGalleries
)
private var List<View>.visibility: Int
@@ -144,12 +146,12 @@ class BatchAddController : NucleusController<EhFragmentBatchAddBinding, BatchAdd
private fun noGalleriesSpecified() {
activity?.let {
MaterialDialog(it)
.title(text = "No galleries to add!")
.message(text = "You must specify at least one gallery to add!")
.positiveButton(android.R.string.ok) { materialDialog -> materialDialog.dismiss() }
.cancelable(true)
.cancelOnTouchOutside(true)
.show()
.title(text = "No galleries to add!")
.message(text = "You must specify at least one gallery to add!")
.positiveButton(android.R.string.ok) { materialDialog -> materialDialog.dismiss() }
.cancelable(true)
.cancelOnTouchOutside(true)
.show()
}
}
}