Automatic contact colours

Closes #133
This commit is contained in:
Moez Bhatti
2019-12-26 18:19:41 -05:00
parent 76e0f775d6
commit 6842374254
25 changed files with 428 additions and 106 deletions
@@ -161,6 +161,9 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
textSize.summary = state.textSizeSummary
textSizeDialog.adapter.selectedItem = state.textSizeId
autoColor.checkbox.isChecked = state.autoColor
systemFont.checkbox.isChecked = state.systemFontEnabled
unicode.checkbox.isChecked = state.stripUnicodeEnabled
@@ -100,6 +100,9 @@ class SettingsPresenter @Inject constructor(
newState { copy(textSizeSummary = textSizeLabels[textSize], textSizeId = textSize) }
}
disposables += prefs.autoColor.asObservable()
.subscribe { autoColor -> newState { copy(autoColor = autoColor) } }
disposables += prefs.systemFont.asObservable()
.subscribe { enabled -> newState { copy(systemFontEnabled = enabled) } }
@@ -164,6 +167,8 @@ class SettingsPresenter @Inject constructor(
R.id.textSize -> view.showTextSizePicker()
R.id.autoColor -> prefs.autoColor.set(!prefs.autoColor.get())
R.id.systemFont -> prefs.systemFont.set(!prefs.systemFont.get())
R.id.unicode -> prefs.unicode.set(!prefs.unicode.get())
@@ -28,6 +28,7 @@ data class SettingsState(
val nightStart: String = "",
val nightEnd: String = "",
val black: Boolean = false,
val autoColor: Boolean = true,
val autoEmojiEnabled: Boolean = true,
val notificationsEnabled: Boolean = true,
val sendDelaySummary: String = "",