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

SnapshotLongStateKt

public final class SnapshotLongStateKt


Summary

Public methods

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

Permits property delegation of vals using by for LongState.

static final @NonNull MutableLongState

Return a new MutableLongState initialized with the passed in value

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

Permits property delegation of vars using by for MutableLongState.

Public methods

getValue

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

Permits property delegation of vals using by for LongState.

mutableLongStateOf

@StateFactoryMarker
public static final @NonNull MutableLongState mutableLongStateOf(long value)

Return a new MutableLongState initialized with the passed in value

The MutableLongState 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 long type, avoiding the autoboxing that occurs when using MutableState<Long>.

Parameters
long value

the initial value for the MutableLongState

setValue

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

Permits property delegation of vars using by for MutableLongState.