Move lambdas outside of parentheses

This commit is contained in:
Moez Bhatti
2018-06-21 08:57:08 -04:00
parent 89b43adfab
commit 9b624d33d5
18 changed files with 96 additions and 96 deletions
@@ -69,7 +69,7 @@ class ThemePickerActivity : QkThemedActivity(), ThemePickerView {
override fun showQksmsPlusSnackbar() {
Snackbar.make(contentView, R.string.toast_qksms_plus, Snackbar.LENGTH_LONG).run {
setAction(R.string.button_more, { viewQksmsPlusIntent.onNext(Unit) })
setAction(R.string.button_more) { viewQksmsPlusIntent.onNext(Unit) }
show()
}
}
@@ -62,20 +62,20 @@ class ThemePickerViewModel @Inject constructor(
.subscribe()
// Toggle the visibility of the apply group
Observables.combineLatest(theme.asObservable(), view.hsvThemeSelectedIntent, { old, new -> old != new })
Observables.combineLatest(theme.asObservable(), view.hsvThemeSelectedIntent) { old, new -> old != new }
.autoDisposable(view.scope())
.subscribe { themeChanged -> newState { copy(applyThemeVisible = themeChanged) } }
// Update the theme, when apply is clicked
view.hsvThemeAppliedIntent
.withLatestFrom(view.hsvThemeSelectedIntent, { _, color -> color })
.withLatestFrom(billingManager.upgradeStatus, { color, upgraded ->
.withLatestFrom(view.hsvThemeSelectedIntent) { _, color -> color }
.withLatestFrom(billingManager.upgradeStatus) { color, upgraded ->
if (!upgraded) {
view.showQksmsPlusSnackbar()
} else {
theme.set(color)
}
})
}
.autoDisposable(view.scope())
.subscribe()
@@ -86,7 +86,7 @@ class ThemePickerViewModel @Inject constructor(
// Reset the theme
view.hsvThemeClearedIntent
.withLatestFrom(theme.asObservable(), { _, color -> color })
.withLatestFrom(theme.asObservable()) { _, color -> color }
.autoDisposable(view.scope())
.subscribe { color -> view.setCurrentTheme(color) }
}