Composable Function

RemoteAllStatesLayout

Displays the child layout matching currentState across all entries of T.

RemoteAllStatesLayout

Source set: JvmAndAndroid
@Composable
public fun <T : Enum<T>> RemoteAllStatesLayout(
    currentState: RemoteEnum<T>,
    modifier: RemoteModifier = RemoteModifier,
    content: @RemoteComposable @Composable (T) -> Unit,
)

Displays the child layout matching currentState across all entries of T.

Interactive example cycling through enum states:

Reducing a larger enum domain to fewer UI states:

Parameters

currentState RemoteEnum selecting the active child layout
modifier RemoteModifier applied to this layout
content composable invoked once per entry of T to build each state's layout

RemoteAllStatesLayout

Source set: JvmAndAndroid
@Composable
public fun RemoteAllStatesLayout(
    currentState: RemoteBoolean,
    modifier: RemoteModifier = RemoteModifier,
    content: @RemoteComposable @Composable (Boolean) -> Unit,
)

Displays the child layout matching currentState for both boolean states.

Interactive example toggling between boolean states:

Parameters

currentState RemoteBoolean selecting the active child layout
modifier RemoteModifier applied to this layout
content composable invoked once for false and once for true

RemoteAllStatesLayout

Source set: JvmAndAndroid
@Composable
public fun RemoteAllStatesLayout(
    currentState: RemoteInt,
    @IntRange(from = 1) stateCount: Int,
    modifier: RemoteModifier = RemoteModifier,
    content: @RemoteComposable @Composable (Int) -> Unit,
)

Displays the child layout matching currentState across states 0 through stateCount - 1.

Interactive example cycling through integer states:

Parameters

currentState RemoteInt selecting the active child layout by zero-based index (falls back to index 0 if out of range at runtime)
stateCount number of integer states (0 through stateCount - 1), must be positive
modifier RemoteModifier applied to this layout
content composable invoked once per index in 0 until stateCount to build each state's layout
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: