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

SnapshotIntStateKt

public final class SnapshotIntStateKt


Summary

Public methods

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

Permits property delegation of vals using by for IntState.

static final @NonNull MutableIntState

Return a new MutableIntState initialized with the passed in value

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

Permits property delegation of vars using by for MutableIntState.

Public methods

getValue

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

Permits property delegation of vals using by for IntState.

mutableIntStateOf

@StateFactoryMarker
public static final @NonNull MutableIntState mutableIntStateOf(int value)

Return a new MutableIntState initialized with the passed in value

The MutableIntState 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 int type, avoiding the autoboxing that occurs when using MutableState<Int>.

Parameters
int value

the initial value for the MutableIntState

setValue

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

Permits property delegation of vars using by for MutableIntState.