Source set: Android
public class MutableRemoteLong
internal constructor(
@get:Suppress("AutoBoxing") public override val constantValueOrNull: Long?,
@get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
internal override val cacheKey: RemoteStateCacheKey,
low: RemoteInt =
constantValueOrNull?.let { RemoteInt(it.toInt()) }
?: RemoteIntExpression(null, RemoteStateInstanceKey()) {
throw UnsupportedOperationException("Cannot extract low from dynamic RemoteLong")
},
high: RemoteInt =
constantValueOrNull?.let { RemoteInt((it shr 32).toInt()) }
?: RemoteIntExpression(null, RemoteStateInstanceKey()) {
throw UnsupportedOperationException("Cannot extract high from dynamic RemoteLong")
},
private val idProvider: (creationState: RemoteComposeCreationState) -> Int,
) : RemoteLong(low, high), MutableRemoteState<Long>
A mutable implementation of RemoteLong.
Parameters
| constantValueOrNull | A nullable value if this MutableRemoteLong is constant. |
Secondary Constructors
internal constructor(
id: Int
) : this(constantValueOrNull = null, cacheKey = RemoteStateIdKey(id), idProvider = { id })
Constructor for MutableRemoteLong that allows specifying an optional initial ID. If no ID is provided, a new float variable ID is reserved.
Parameters
| id | An optional explicit ID for this mutable long. If null, a new ID is reserved. |
Companion Object
Methods
Source set: Android
public operator fun invoke(initialValue: Long): MutableRemoteLong
Creates a new mutable state (allocates an ID).
Parameters
| initialValue | The initial value for the state. |
Returns
| A new MutableRemoteLong instance. |