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

RemoteDp

Represents a Density-independent pixel (Dp) value.

Source set: Android
public class RemoteDp internal constructor(
    @get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) public val value: RemoteFloat
) : BaseRemoteState<Dp>(RemoteStateInstanceKey())

Represents a Density-independent pixel (Dp) value.

RemoteDp represents a Dp value that can be a constant, a named variable, or a dynamic expression.

Properties

constantValueOrNull

Source set: Android
override val constantValueOrNull: Dp?

Functions

toPx

Source set: Android
public fun toPx(density: RemoteDensity): RemoteFloat

Function to convert this RemoteDp to a density-independent pixel value. It multiplies the current float value by the screen\'s density.

toPx

Source set: Android
public fun toPx(): RemoteFloat

Converts a RemoteDp to a RemoteFloat Px using the RemoteDensity.

plus

Source set: Android
public operator fun plus(other: RemoteDp): RemoteDp

Add two RemoteDps together.

minus

Source set: Android
public operator fun minus(other: RemoteDp): RemoteDp

Subtract a RemoteDp from another one.

unaryMinus

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

This is the same as multiplying the Dp by -1.0.

div

Source set: Android
public operator fun div(other: Float): RemoteDp

Divide a RemoteDp by a scalar.

div

Source set: Android
public operator fun div(other: Int): RemoteDp

Divide a RemoteDp by a scalar.

div

Source set: Android
public operator fun div(other: RemoteFloat): RemoteDp

Divide a RemoteDp by a RemoteFloat.

div

Source set: Android
public operator fun div(other: RemoteInt): RemoteDp

Divide a RemoteDp by a RemoteInt.

div

Source set: Android
public operator fun div(other: RemoteDp): RemoteFloat

Divide by another RemoteDp to get a scalar.

times

Source set: Android
public operator fun times(other: Float): RemoteDp

Multiply a RemoteDp by a scalar.

times

Source set: Android
public operator fun times(other: Int): RemoteDp

Multiply a RemoteDp by a scalar.

times

Source set: Android
public operator fun times(other: RemoteFloat): RemoteDp

Multiply a RemoteDp by a RemoteFloat.

times

Source set: Android
public operator fun times(other: RemoteInt): RemoteDp

Multiply a RemoteDp by a RemoteInt.

isLessThan

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

Check if this RemoteDp is less than other.

isLessThanOrEqualTo

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

Check if this RemoteDp is less than or equal to other.

isGreaterThan

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

Check if this RemoteDp is greater than other.

isGreaterThanOrEqualTo

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

Check if this RemoteDp is greater than or equal to other.

isEqualTo

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

Check if this RemoteDp is equal to other.

isNotEqualTo

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

Check if this RemoteDp is not equal to other.

Members

Companion

Source set: Android
public companion object

Functions

invoke

Source set: Android
public operator fun invoke(value: Dp): RemoteDp

Creates a RemoteDp from a literal Dp value.

Parameters

value The Dp value.

Return

A RemoteDp representing the constant Dp.

createNamedRemoteDp

Source set: Android
public fun createNamedRemoteDp(
            name: String,
            defaultValue: Dp,
            domain: RemoteState.Domain = RemoteState.Domain.User,
        ): RemoteDp

Creates a named RemoteDp with an initial value.

Named remote Dps can be set via AndroidRemoteContext.setNamedFloat.

Parameters

name A unique name to identify this state within its domain.
defaultValue The initial Dp value for the named remote Dp.
domain The domain for the named state. Defaults to RemoteState.Domain.User.

Return

A RemoteDp representing the named Dp.

Content updated: