mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-20 20:58:54 +01:00
Fix theme not updating when going back to settings
This commit is contained in:
@@ -40,19 +40,20 @@ import java.util.concurrent.TimeUnit
|
|||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class SettingsPresenter @Inject constructor(
|
class SettingsPresenter @Inject constructor(
|
||||||
|
colors: Colors,
|
||||||
|
syncRepo: SyncRepository,
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
private val billingManager: BillingManager,
|
private val billingManager: BillingManager,
|
||||||
private val colors: Colors,
|
|
||||||
private val dateFormatter: DateFormatter,
|
private val dateFormatter: DateFormatter,
|
||||||
private val navigator: Navigator,
|
private val navigator: Navigator,
|
||||||
private val nightModeManager: NightModeManager,
|
private val nightModeManager: NightModeManager,
|
||||||
private val prefs: Preferences,
|
private val prefs: Preferences,
|
||||||
private val syncMessages: SyncMessages,
|
private val syncMessages: SyncMessages
|
||||||
private val syncRepo: SyncRepository
|
) : QkPresenter<SettingsView, SettingsState>(SettingsState()) {
|
||||||
) : QkPresenter<SettingsView, SettingsState>(SettingsState(theme = colors.theme().theme)) {
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
newState { copy(theme = colors.theme().theme) }
|
disposables += colors.themeObservable()
|
||||||
|
.subscribe { theme -> newState { copy(theme = theme.theme) } }
|
||||||
|
|
||||||
val nightModeLabels = context.resources.getStringArray(R.array.night_modes)
|
val nightModeLabels = context.resources.getStringArray(R.array.night_modes)
|
||||||
disposables += prefs.nightMode.asObservable()
|
disposables += prefs.nightMode.asObservable()
|
||||||
|
|||||||
Reference in New Issue
Block a user