{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

SnapshotFloatStateKt

public final class SnapshotFloatStateKt


Summary

Public methods

static final float
getValue(
    @NonNull FloatState receiver,
    Object thisObj,
    @NonNull KProperty<@NonNull ?> property
)

Permits property delegation of vals using by for FloatState.

static final @NonNull MutableFloatState

Return a new MutableFloatState initialized with the passed in value

static final void
setValue(
    @NonNull MutableFloatState receiver,
    Object thisObj,
    @NonNull KProperty<@NonNull ?> property,
    float value
)

Permits property delegation of vars using by for MutableFloatState.

Public methods

getValue

public static final float getValue(
    @NonNull FloatState receiver,
    Object thisObj,
    @NonNull KProperty<@NonNull ?> property
)

Permits property delegation of vals using by for FloatState.

mutableFloatStateOf

@StateFactoryMarker
public static final @NonNull MutableFloatState mutableFloatStateOf(float value)

Return a new MutableFloatState initialized with the passed in value

The MutableFloatState class is a single value holder whose reads and writes are observed by Compose. Additionally, writes to it are transacted as part of the Snapshot system. On the JVM, values are stored in memory as the primitive float type, avoiding the autoboxing that occurs when using MutableState<Float>.

Parameters
float value

the initial value for the MutableFloatState

setValue

public static final void setValue(
    @NonNull MutableFloatState receiver,
    Object thisObj,
    @NonNull KProperty<@NonNull ?> property,
    float value
)

Permits property delegation of vars using by for MutableFloatState.