SpaceToggleButton

Functions summary

Unit
@Composable
SpaceToggleButton(
    modifier: Modifier,
    colors: IconToggleButtonColors,
    content: @Composable (isFullSpace: Boolean) -> Unit
)

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

Functions

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

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

It adapts to the current spatial mode, visually representing it with either a default icon or provided custom content.

Parameters
modifier: Modifier = Modifier

The modifier to be applied to the button layout.

colors: IconToggleButtonColors = IconButtonDefaults.iconToggleButtonColors()

IconToggleButtonColors that will be used to resolve the colors for this button.

content: @Composable (isFullSpace: Boolean) -> Unit = { isFullSpace -> if (isFullSpace) { SpaceToggleButtonDefaults.CollapseIcon() } else { SpaceToggleButtonDefaults.ExpandIcon() } }

The content to be displayed inside the button.