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

SnapshotDoubleStateKt

public final class SnapshotDoubleStateKt


Summary

Public methods

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

Permits property delegation of vals using by for DoubleState.

static final @NonNull MutableDoubleState

Return a new MutableDoubleState initialized with the passed in value

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

Permits property delegation of vars using by for MutableDoubleState.

Public methods

getValue

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

Permits property delegation of vals using by for DoubleState.

mutableDoubleStateOf

@StateFactoryMarker
public static final @NonNull MutableDoubleState mutableDoubleStateOf(double value)

Return a new MutableDoubleState initialized with the passed in value

The MutableDoubleState 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 double type, avoiding the autoboxing that occurs when using MutableState<Double>.

Parameters
double value

the initial value for the MutableDoubleState

setValue

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

Permits property delegation of vars using by for MutableDoubleState.