InMemoryShellPreferencesRepository

class InMemoryShellPreferencesRepository(initial: ShellSettings = ShellSettings(), val defaults: ShellSettings = ShellSettings()) : ShellPreferencesRepository(source)

ShellPreferencesRepository kept in memory, for tests, previews, and apps that do not persist the shell's settings. Starts from initial, and a reset returns to defaults.

Constructors

Link copied to clipboard
constructor(initial: ShellSettings = ShellSettings(), defaults: ShellSettings = ShellSettings())

Properties

Link copied to clipboard
open override val defaults: ShellSettings

The app's defaults: what a setting nobody chose reads as, and what resetDeveloperOptions returns to. The Toolkit's own defaults unless the app declared its own.

Link copied to clipboard
open override val lastKnown: ShellSettings

The settings last read in this process, if any, so an activity recreated by a rotation starts from them instead of waiting a frame for the store.

Link copied to clipboard
open override val settings: StateFlow<ShellSettings>

The current settings, then every change.

Functions

Link copied to clipboard
open suspend fun resetDeveloperOptions()

Forgets every developer option, so the shell is again as the app declares it in defaults. Every ShellSettings value is a developer option; the person's own preferences live elsewhere and are not touched.

Link copied to clipboard
open suspend fun setAccessoryMode(value: AccessoryMode)
Link copied to clipboard
open suspend fun setAnimationSpeed(value: AnimationSpeed)
Link copied to clipboard
open suspend fun setBackEdgeStyle(value: BackEdgeStyle)
Link copied to clipboard
open suspend fun setEntranceReplay(value: EntranceReplay)
Link copied to clipboard
open suspend fun setEntranceStyle(value: EntranceStyle)
Link copied to clipboard
open suspend fun setHideBottomBarOnScroll(value: Boolean)
Link copied to clipboard
open suspend fun setHideTopBarOnScroll(value: Boolean)
Link copied to clipboard
open suspend fun setLayoutMode(value: ShellLayoutMode)
Link copied to clipboard
open suspend fun setLimitContentWidth(value: Boolean)
Link copied to clipboard
open suspend fun setMotionTempo(value: MotionTempo)
Link copied to clipboard
open suspend fun setNavigationBarStyle(value: NavigationBarStyle)
Link copied to clipboard
open suspend fun setNavigationTint(value: NavigationTint)
Link copied to clipboard
open suspend fun setStartOverride(value: Int)
Link copied to clipboard
open suspend fun setTabTransition(value: TabTransitionStyle)
Link copied to clipboard
open suspend fun setTopBarOverride(value: TopBarOverride)
Link copied to clipboard
open suspend override fun update(transform: (ShellSettings) -> ShellSettings)

Replaces the settings with transform applied to the current ones, atomically.