DefaultSeasonalThemePreferencesDataSource

Seasonal preferences in the shared settings DataStore. Unknown weather-effect names use WeatherEffect.Automatic; unknown season names produce no holiday snapshot. Snapshot fields are written or cleared in one transaction.

Constructors

constructor(dataStore: DataStore<Preferences>)

Properties

Link copied to clipboard
open override val holidayThemeSnapshot: Flow<HolidayThemeSnapshot?>

Emits the appearance saved before a holiday theme was applied, or null if none is in use.

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

Emits the occurrence key of the last holiday greeting answered, or null if none was.

Link copied to clipboard
open override val seasonalThemesUnlocked: Flow<Boolean>

Emits whether the About screen easter egg has been found.

Link copied to clipboard
open override val weatherEffect: Flow<WeatherEffect>

Emits what falls over the app; WeatherEffect.Automatic until another is chosen.

Functions

Link copied to clipboard
open suspend override fun saveHolidayThemeSnapshot(snapshot: HolidayThemeSnapshot?)

Persists the appearance to restore after the holiday, or clears it when snapshot is null.

Link copied to clipboard
open suspend override fun saveLastHolidayGreeting(occurrenceKey: String)
Link copied to clipboard
open suspend override fun saveSeasonalThemesUnlocked(unlocked: Boolean)
Link copied to clipboard
open suspend override fun saveWeatherEffect(effect: WeatherEffect)
Link copied to clipboard
open suspend override fun unlockSeasonalThemes(): Boolean

Atomically unlocks the controls and returns true only for the first successful writer.

Link copied to clipboard
open suspend override fun updateHolidayTheme(transform: (HolidayThemePreferences) -> HolidayThemePreferences)

Reads and conditionally replaces the palette and snapshot in one serialized transaction.