Composable Component

SpaceToggleButton

A composable button that toggles between "Full Space" and "Home Space" in an Android XR application.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

SpaceToggleButton

Android
@Composable
public fun SpaceToggleButton(
    modifier: Modifier = Modifier,
    colors: IconToggleButtonColors = IconButtonDefaults.iconToggleButtonColors(),
    content: @Composable (isFullSpace: Boolean) -> Unit = { isFullSpace ->
        if (isFullSpace) {
            SpaceToggleButtonDefaults.CollapseIcon()
        } else {
            SpaceToggleButtonDefaults.ExpandIcon()
        }
    },
)

Parameters

modifier The modifier to be applied to the button layout.
colors IconToggleButtonColors that will be used to resolve the colors for this button.
content The content to be displayed inside the button.