DefaultThemePreferencesDataSource

Appearance preferences stored in the shared settings Preferences DataStore.

Constructors

Link copied to clipboard
constructor(dataStore: DataStore<Preferences>)

Properties

Link copied to clipboard
open override val amoledMode: Flow<Boolean>
Link copied to clipboard
open override val dynamicColors: Flow<Boolean>
Link copied to clipboard
open override val dynamicPaletteVariant: Flow<Int>

Emits the selected dynamic palette variant, clamped to a supported index.

Link copied to clipboard
open override val staticPaletteId: Flow<String>

Emits the selected static palette id, sanitized to a known palette.

Link copied to clipboard
open override val storedPreferences: Flow<ThemePreferencesState>

Emits every stored value at once, each as its own flow above reports it.

Link copied to clipboard
open override val themeMode: Flow<String>

Emits the stored theme mode, defaulting to "follow system".

Functions

Link copied to clipboard
open suspend override fun saveAmoledMode(isChecked: Boolean)
Link copied to clipboard
open suspend override fun saveDynamicColors(isChecked: Boolean)
Link copied to clipboard
open suspend override fun saveDynamicPaletteVariant(variant: Int)

Persists the dynamic palette variant, clamped to a supported index.

Link copied to clipboard
open suspend override fun savePalette(dynamicColors: Boolean, dynamicPaletteVariant: Int? = null, staticPaletteId: String? = null)

Persists a palette choice: whether dynamic colors are on, plus the palette that goes with it. A null value is left unchanged.

Link copied to clipboard
open suspend override fun saveStaticPaletteId(id: String)

Persists the static palette id, sanitized to a known palette.

Link copied to clipboard
open suspend override fun saveThemeMode(mode: String)