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

RemoteBoolean

A class representing a remote boolean value.

Source set: Android
public open class RemoteBoolean internal constructor(internal val intValue: RemoteInt) :
    BaseRemoteState<Boolean>(RemoteStateInstanceKey())

A class representing a remote boolean value.

RemoteBoolean internally stores its state as a RemoteInt, typically using 1 for true and 0 for false. This allows boolean logic to be evaluated efficiently on the remote rendering engine.

Properties

constantValueOrNull

Source set: Android
public override val constantValueOrNull: Boolean?

asEncoded

Source set: Android
override val asEncoded: RemoteInt

Functions

not

Source set: Android
public operator fun not(): RemoteBoolean

Logical NOT operator for RemoteBoolean.

This creates a new RemoteBoolean whose value is the logical inverse of this boolean. It achieves this by performing a bitwise XOR operation with 1 on the underlying RemoteInt.

Return

A new RemoteBoolean representing the logical NOT of this boolean.

toRemoteInt

Source set: Android
public fun toRemoteInt(): RemoteInt

Converts this RemoteBoolean to its underlying RemoteInt representation, which evaluates to 1 for true and 0 for false.

Return

The RemoteInt that holds the boolean\'s value.

select

Source set: Android
public fun select(ifTrue: RemoteString, ifFalse: RemoteString): RemoteString

If this RemoteBoolean evaluates to true then the returned value evaluates to ifTrue otherwise it evaluates to ifFalse.

Parameters

ifTrue The RemoteString to be selected if this boolean is true.
ifFalse The RemoteString to be selected if this boolean is false.

Return

A new RemoteString representing the conditionally selected string.

select

Source set: Android
public fun select(ifTrue: RemoteFloat, ifFalse: RemoteFloat): RemoteFloat

If this RemoteBoolean evaluates to true then the returned value evaluates to ifTrue otherwise it evaluates to ifFalse.

Parameters

ifTrue The RemoteFloat to be selected if this boolean is true.
ifFalse The RemoteFloat to be selected if this boolean is false.

Return

A new RemoteFloat representing the conditionally selected float value.

select

Source set: Android
public fun select(ifTrue: RemoteInt, ifFalse: RemoteInt): RemoteInt

If this RemoteBoolean evaluates to true then the returned value evaluates to ifTrue otherwise it evaluates to ifFalse.

Parameters

ifTrue The RemoteInt to be selected if this boolean is true.
ifFalse The RemoteInt to be selected if this boolean is false.

Return

A new RemoteInt representing the conditionally selected integer value.

select

Source set: Android
public fun select(ifTrue: RemoteBoolean, ifFalse: RemoteBoolean): RemoteBoolean

If this RemoteBoolean evaluates to true then the returned value evaluates to ifTrue otherwise it evaluates to ifFalse.

Parameters

ifTrue The RemoteBoolean to be selected if this boolean is true.
ifFalse The RemoteBoolean to be selected if this boolean is false.

Return

A new RemoteBoolean representing the conditionally selected integer value.

select

Source set: Android
public fun select(ifTrue: RemoteColor, ifFalse: RemoteColor): RemoteColor

If this RemoteBoolean evaluates to true then the returned value evaluates to ifTrue otherwise it evaluates to ifFalse.

Parameters

ifTrue The RemoteColor to be selected if this boolean is true.
ifFalse The RemoteColor to be selected if this boolean is false.

Return

A new RemoteColor representing the conditionally selected color.

select

Source set: Android
public fun select(ifTrue: RemoteDp, ifFalse: RemoteDp): RemoteDp

If this RemoteBoolean evaluates to true then the returned value evaluates to ifTrue otherwise it evaluates to ifFalse.

Parameters

ifTrue The RemoteDp to be selected if this boolean is true.
ifFalse The RemoteDp to be selected if this boolean is false.

Return

A new RemoteDp representing the conditionally selected Dp value.

isEqualTo

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

Equality operator for RemoteBooleans.

Returns a new RemoteBoolean that evaluates to true if this boolean's underlying RemoteInt is equal to another RemoteBoolean's underlying RemoteInt.

Parameters

other The other RemoteBoolean to compare with.

Return

A new RemoteBoolean representing the result of the equality comparison.

isNotEqualTo

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

Inequality operator for RemoteBooleans.

Returns a new RemoteBoolean that evaluates to true if this boolean's underlying RemoteInt is not equal to another RemoteBoolean's underlying RemoteInt.

Parameters

other The other RemoteBoolean to compare with.

Return

A new RemoteBoolean representing the result of the inequality comparison.

or

Source set: Android
public infix fun or(other: RemoteBoolean): RemoteBoolean

Logical OR operator for RemoteBooleans.

Performs a bitwise OR operation on the underlying RemoteInt values of this boolean and the other RemoteBoolean. The result is a new RemoteBoolean.

This is designed to align with the standard Kotlin Boolean.or infix function.

Parameters

other The other RemoteBoolean to perform the OR operation with.

Return

A new RemoteBoolean representing the result of the logical OR.

and

Source set: Android
public infix fun and(other: RemoteBoolean): RemoteBoolean

Logical AND operator for RemoteBooleans.

Performs a bitwise AND operation on the underlying RemoteInt values of this boolean and the other RemoteBoolean. The result is a new RemoteBoolean.

This is designed to align with the standard Kotlin Boolean.and infix function.

Parameters

other The other RemoteBoolean to perform the AND operation with.

Return

A new RemoteBoolean representing the result of the logical AND.

xor

Source set: Android
public infix fun xor(other: RemoteBoolean): RemoteBoolean

Logical XOR operator for RemoteBooleans.

Performs a bitwise XOR operation on the underlying RemoteInt values of this boolean and the other RemoteBoolean. The result is a new RemoteBoolean.

This is designed to align with the standard Kotlin Boolean.xor infix function.

Parameters

other The other RemoteBoolean to perform the XOR operation with.

Return

A new RemoteBoolean representing the result of the logical XOR.

Members

Companion

Source set: Android
public companion object

Functions

invoke

Source set: Android
public operator fun invoke(value: Boolean): RemoteBoolean

Creates a RemoteBoolean from a literal constant.

Parameters

value The constant Boolean value.

Return

A RemoteBoolean representing the constant boolean.

createNamedRemoteBoolean

Source set: Android
public fun createNamedRemoteBoolean(
            name: String,
            defaultValue: Boolean,
            domain: RemoteState.Domain = RemoteState.Domain.User,
        ): RemoteBoolean

Creates a named RemoteBoolean with an initial value. Named remote booleans can be set via AndroidRemoteContext.setNamedBoolean.

Parameters

name The unique name for this remote boolean.
domain The domain of the named boolean (defaults to RemoteState.Domain.User).
defaultValue The initial Boolean value for the named remote boolean.

Return

A RemoteBoolean representing the named boolean.

Content updated: