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

RemoteFloat

Abstract base class for all remote float representations.

Source set: Android
public abstract class RemoteFloat internal constructor(cacheKey: RemoteStateCacheKey) :
    BaseRemoteState<Float>(cacheKey)

Abstract base class for all remote float representations.

RemoteFloat represents a floating-point value that can be a constant, a possibly named variable, or a dynamic expression (e.g., an arithmetic operation).

Functions

toRemoteInt

Source set: Android
public fun toRemoteInt(): RemoteInt

Returns a RemoteInt that evaluates to the result of this RemoteFloat converted to Int.

toRemoteString

Source set: Android
public fun toRemoteString(
        format: android.icu.text.DecimalFormat = DefaultDecimalFormat
    ): RemoteString

Returns a RemoteString that evaluates to the result of this RemoteFloat formatted according to the provided android.icu.text.DecimalFormat.

This method maps the localized ICU android.icu.text.DecimalFormat configuration (including padding, rounding, and digit constraints) to a remote-compatible string representation. It specifically handles complex padding logic and threshold-based selections to ensure the formatted output remains consistent when evaluated on the remote target.

Parameters

format The ICU android.icu.text.DecimalFormat to use for determining formatting options like separators, grouping, and padding width.

Return

A RemoteString representing the formatted float.

toRemoteString

Source set: Android
public fun toRemoteString(format: DecimalFormat): RemoteString

Returns a RemoteString that evaluates to the result of this RemoteFloat formatted according to the provided DecimalFormat.

This method maps the localized DecimalFormat symbols (such as separators and grouping sizes) and configuration (such as padding and rounding) to a remote-compatible string representation.

Parameters

format The DecimalFormat to use for determining separators, grouping, and padding.

Return

A RemoteString representing the formatted float.

unaryMinus

Source set: Android
public operator fun unaryMinus(): RemoteFloat

Returns a new RemoteFloat that evaluates to the negative of this RemoteFloat.

rem

Source set: Android
public operator fun rem(v: RemoteFloat): RemoteFloat

Returns a new RemoteFloat that evaluates to this RemoteFloat modulo v.

min

Source set: Android
public fun min(v: RemoteFloat): RemoteFloat

Returns a new RemoteFloat that evaluates to minimum of this RemoteFloat and v.

plus

Source set: Android
public operator fun plus(v: RemoteFloat): RemoteFloat

Returns a new RemoteFloat that evaluates to this RemoteFloat plus v.

minus

Source set: Android
public operator fun minus(v: RemoteFloat): RemoteFloat

Returns a new RemoteFloat that evaluates to this RemoteFloat minus v.

times

Source set: Android
public operator fun times(v: RemoteFloat): RemoteFloat

Returns a new RemoteFloat that evaluates to this RemoteFloat times v.

div

Source set: Android
public operator fun div(v: RemoteFloat): RemoteFloat

Returns a new RemoteFloat that evaluates to this RemoteFloat div v.

isEqualTo

Source set: Android
public fun isEqualTo(other: RemoteFloat): RemoteBoolean

Returns a RemoteBoolean that evaluates to true if other is equal to the value of this RemoteFloat or false otherwise.

isNotEqualTo

Source set: Android
public fun isNotEqualTo(other: RemoteFloat): RemoteBoolean

Returns a RemoteBoolean that evaluates to true if other is not equal to the value of this RemoteFloat or false otherwise.

isLessThan

Source set: Android
public fun isLessThan(other: RemoteFloat): RemoteBoolean

Returns a RemoteBoolean that evaluates to true if other is less than the value of this RemoteFloat or false otherwise.

isLessThanOrEqualTo

Source set: Android
public fun isLessThanOrEqualTo(other: RemoteFloat): RemoteBoolean

Returns a RemoteBoolean that evaluates to true if other is less than or equal to the value of this RemoteFloat or false otherwise.

isGreaterThan

Source set: Android
public fun isGreaterThan(other: RemoteFloat): RemoteBoolean

Returns a RemoteBoolean that evaluates to true if other is greater than the value of this RemoteFloat or false otherwise.

isGreaterThanOrEqualTo

Source set: Android
public fun isGreaterThanOrEqualTo(other: RemoteFloat): RemoteBoolean

Returns a RemoteBoolean that evaluates to true if other is greater than or equal to the value of this RemoteFloat or false otherwise.

Members

Companion

Source set: Android
public companion object

Functions

invoke

Source set: Android
public operator fun invoke(value: Float): RemoteFloat

Creates a RemoteFloat from a constant Float value.

Parameters

value The value to wrap.

Return

A RemoteFloat representing the given constant or encoded id.

createNamedRemoteFloat

Source set: Android
public fun createNamedRemoteFloat(
            name: String,
            defaultValue: Float,
            domain: RemoteState.Domain = RemoteState.Domain.User,
        ): RemoteFloat

Creates a named RemoteFloat with an initial value. This allows referring to a float by a symbolic name in the remote document. Named remote ints can be set via AndroidRemoteContext.setNamedFloat.

Parameters

name The name of the remote float.
defaultValue The initial value of the remote float.
domain The domain of the named float (defaults to RemoteState.Domain.User). This helps avoid name collisions.

Return

A RemoteFloat representing the named float.

createNamedRemoteFloatExpression

Source set: Android
public fun createNamedRemoteFloatExpression(
            name: String,
            domain: RemoteState.Domain = RemoteState.Domain.User,
            expression: RemoteFloatContext.() -> RemoteFloat,
        ): RemoteFloat

Content updated: