🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

MutableStyleState

The state a style that can be updated to reflect the current state of a component.

Source set: Common
public class MutableStyleState constructor(override val interactionSource: InteractionSource?) : StyleState()

The state a style that can be updated to reflect the current state of a component. This value should be created in a component and updated to select the style parameter to be set for the component.

A component that uses an interaction source can create a MutableStyleState that observes the interactions emitted to the interaction source.

Properties

isEnabled

Source set: Common
override var isEnabled: Boolean

isFocused

Source set: Common
override var isFocused: Boolean

isHovered

Source set: Common
override var isHovered: Boolean

isPressed

Source set: Common
override var isPressed: Boolean

isSelected

Source set: Common
override var isSelected: Boolean

triStateToggle

Source set: Common
override var triStateToggle: ToggleableState

isChecked

Source set: Common
override var isChecked: Boolean

Functions

get

Source set: Common
override operator fun <T> get(key: StyleStateKey<T>): T

set

Source set: Common
public operator fun <T> set(key: StyleStateKey<T>, value: T)

Set the value of the key in the StyleState.

remove

Source set: Common
public fun <T> remove(key: StyleStateKey<T>)

Removes the StyleStateKey from the StyleState.

A Style will read the StyleStateKey.defaultValue for the StyleStateKey when the key is not present in the StyleState.

Removing a key that is updated via an InteractionSource will no longer observe the interaction source.

Predefined style keys, such as StyleStateKey.Pressed and StyleStateKey.Hovered, cannot be removed from the set of keys and this will throw if removed.

processInteractions

Source set: Common
override suspend fun processInteractions(interactions: InteractionSource)