androidx.ui.foundation.selection

Enums

ToggleableState

Enum that represents possible toggleable states.

Top-level functions summary

Unit
MutuallyExclusiveSetItem(selected: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier.None, children: () -> Unit)

Component for representing one option out of many in mutually exclusion set, e.

Unit
Toggleable(value: Boolean, onValueChange: (Boolean) -> Unit, enabled: Boolean = true, modifier: Modifier = Modifier.None, children: () -> Unit)

Combines TapGestureDetector and Semantics for the components that need to be toggleable, like Switch.

ToggleableState

Return corresponding ToggleableState based on a Boolean representation

Unit
TriStateToggleable(state: ToggleableState = On, onClick: () -> Unit, enabled: Boolean = true, modifier: Modifier = Modifier.None, children: () -> Unit)

Combines TapGestureDetector and Semantics for the components with three states like TriStateCheckbox.

Top-level functions

MutuallyExclusiveSetItem

@Composable fun MutuallyExclusiveSetItem(
    selected: Boolean,
    onClick: () -> Unit,
    modifier: Modifier = Modifier.None,
    children: () -> Unit
): Unit

Component for representing one option out of many in mutually exclusion set, e.g androidx.ui.material.RadioGroup

Provides click handling as well as Semantics for accessibility

Parameters
selected: Boolean whether or not this item is selected in mutually exclusion set
onClick: () -> Unit callback to invoke when this item is clicked
modifier: Modifier = Modifier.None allows to provide a modifier to be added before the gesture detector, for example Ripple should be added at this point. this will be easier once we migrate this function to a Modifier

Toggleable

@Composable fun Toggleable(
    value: Boolean,
    onValueChange: (Boolean) -> Unit,
    enabled: Boolean = true,
    modifier: Modifier = Modifier.None,
    children: () -> Unit
): Unit

Combines TapGestureDetector and Semantics for the components that need to be toggleable, like Switch.


//Unresolved: androidx.ui.foundation.samples.ToggleableSample
Parameters
value: Boolean whether Toggleable is on or off
onValueChange: (Boolean) -> Unit callback to be invoked when toggleable is being clicked, therefore the change of the state in requested.
enabled: Boolean = true enabled whether or not this Toggleable will handle input events and appear enabled for semantics purposes
modifier: Modifier = Modifier.None allows to provide a modifier to be added before the gesture detector, for example Ripple should be added at this point. this will be easier once we migrate this function to a Modifier

ToggleableState

fun ToggleableState(value: Boolean): ToggleableState

Return corresponding ToggleableState based on a Boolean representation

Parameters
value: Boolean whether the ToggleableState is on or off

TriStateToggleable

@Composable fun TriStateToggleable(
    state: ToggleableState = On,
    onClick: () -> Unit,
    enabled: Boolean = true,
    modifier: Modifier = Modifier.None,
    children: () -> Unit
): Unit

Combines TapGestureDetector and Semantics for the components with three states like TriStateCheckbox.

It supports three states: On, Off and Indeterminate.

TriStateToggleable should be used when there are dependent Toggleables associated to this component and those can have different values.


//Unresolved: androidx.ui.foundation.samples.TriStateToggleableSample

See Also

Parameters
state: ToggleableState = On current value for the component
onClick: () -> Unit will be called when user toggles the toggleable.
enabled: Boolean = true enabled whether or not this TriStateToggleable will handle input events and appear enabled for semantics purposes
modifier: Modifier = Modifier.None allows to provide a modifier to be added before the gesture detector, for example Ripple should be added at this point. this will be easier once we migrate this function to a Modifier