forked from upstream-mirrors/quik
Remove SetupActivity, perform setup in MainActivity
Squashed commit of the following: commit ff6ece72a60917ceec3ea1485901e8929e65bb43 Author: Moez Bhatti <moez.bhatti@gmail.com> Date: Wed May 9 01:50:33 2018 -0400 Remove default SMS UI from settings commit 1ce79ea756259268c4d2fcd8acbee3101fdbe019 Author: Moez Bhatti <moez.bhatti@gmail.com> Date: Wed May 9 01:45:33 2018 -0400 Remove SetupActivity, perform setup in MainActivity commit ccad342d2ab8a5346d63dab273ba9cadb2fa62c0 Author: Moez Bhatti <moez.bhatti@gmail.com> Date: Mon May 7 18:02:26 2018 -0400 Don't query ContentProvider without appropriate permission commit 527be2e5331ba0cbfd6f3375c12378105d282b0c Author: Moez Bhatti <moez.bhatti@gmail.com> Date: Mon May 7 17:12:00 2018 -0400 Show non-blocking UI in MainActivity while syncing
This commit is contained in:
@@ -29,7 +29,7 @@ import common.util.Colors
|
||||
import common.util.DateFormatter
|
||||
import common.util.NightModeManager
|
||||
import injection.appComponent
|
||||
import interactor.FullSync
|
||||
import interactor.SyncMessages
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
import io.reactivex.rxkotlin.withLatestFrom
|
||||
import timber.log.Timber
|
||||
@@ -46,17 +46,11 @@ class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState
|
||||
@Inject lateinit var navigator: Navigator
|
||||
@Inject lateinit var nightModeManager: NightModeManager
|
||||
@Inject lateinit var prefs: Preferences
|
||||
@Inject lateinit var fullSync: FullSync
|
||||
@Inject lateinit var syncMessages: SyncMessages
|
||||
|
||||
init {
|
||||
appComponent.inject(this)
|
||||
|
||||
disposables += prefs.defaultSms
|
||||
.asObservable()
|
||||
.subscribe { isDefaultSmsApp ->
|
||||
newState { it.copy(isDefaultSmsApp = isDefaultSmsApp) }
|
||||
}
|
||||
|
||||
disposables += colors.theme
|
||||
.subscribe { color -> newState { it.copy(theme = color) } }
|
||||
|
||||
@@ -108,7 +102,7 @@ class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState
|
||||
newState { it.copy(maxMmsSizeSummary = mmsSizeLabels[index], maxMmsSizeId = maxMmsSize) }
|
||||
}
|
||||
|
||||
disposables += fullSync
|
||||
disposables += syncMessages
|
||||
}
|
||||
|
||||
override fun bindView(view: SettingsView) {
|
||||
@@ -120,8 +114,6 @@ class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState
|
||||
Timber.v("Preference click: ${context.resources.getResourceName(it.id)}")
|
||||
|
||||
when (it.id) {
|
||||
R.id.defaultSms -> navigator.showDefaultSmsDialog()
|
||||
|
||||
R.id.theme -> navigator.showThemePicker()
|
||||
|
||||
R.id.night -> view.showNightModeDialog()
|
||||
@@ -158,7 +150,7 @@ class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState
|
||||
|
||||
R.id.sync -> {
|
||||
newState { it.copy(syncing = true) }
|
||||
fullSync.execute(Unit, {
|
||||
syncMessages.execute(Unit, {
|
||||
newState { it.copy(syncing = false) }
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user