mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: add high-contrast theme with accessible message bubbles (#5135)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
f48fc61729
commit
fa63a4ac50
19 changed files with 328 additions and 65 deletions
|
|
@ -62,6 +62,13 @@ class UiPrefsImpl(
|
|||
scope.launch { dataStore.edit { it[KEY_THEME] = value } }
|
||||
}
|
||||
|
||||
override val contrastLevel: StateFlow<Int> =
|
||||
dataStore.data.map { it[KEY_CONTRAST_LEVEL] ?: 0 }.stateIn(scope, SharingStarted.Lazily, 0)
|
||||
|
||||
override fun setContrastLevel(value: Int) {
|
||||
scope.launch { dataStore.edit { it[KEY_CONTRAST_LEVEL] = value } }
|
||||
}
|
||||
|
||||
override val locale: StateFlow<String> =
|
||||
dataStore.data.map { it[KEY_LOCALE] ?: "" }.stateIn(scope, SharingStarted.Eagerly, "")
|
||||
|
||||
|
|
@ -152,6 +159,7 @@ class UiPrefsImpl(
|
|||
|
||||
val KEY_APP_INTRO_COMPLETED = booleanPreferencesKey("app_intro_completed")
|
||||
val KEY_THEME = intPreferencesKey("theme")
|
||||
val KEY_CONTRAST_LEVEL = intPreferencesKey("contrast-level")
|
||||
val KEY_LOCALE = stringPreferencesKey("locale")
|
||||
val KEY_NODE_SORT = intPreferencesKey("node-sort-option")
|
||||
val KEY_INCLUDE_UNKNOWN = booleanPreferencesKey("include-unknown")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue