RemoteButtonGroupScope

@RemoteLayoutScopeMarker
sealed interface RemoteButtonGroupScope


Scope for the children of a RemoteButtonGroup.

Each child should build its own modifier chain and chain RemoteButtonGroupScope modifiers (weight, minWidth, animateWidth) contiguously before any other modifiers; do not share a scope modifier instance across multiple children.

Summary

Public functions

RemoteModifier

Specifies that this item should animate its width when pressed, expanding its resting width by RemoteButtonGroup's expansionWidth delta while neighboring items shrink accordingly.

RemoteModifier

Sets the minimum width of this item, defaults to RemoteButtonGroupDefaults.MinWidth.

RemoteModifier

Size the element's width proportional to its weight relative to other weighted sibling elements in the RemoteButtonGroup.

Public functions

RemoteModifier.animateWidth

fun RemoteModifier.animateWidth(): RemoteModifier

Specifies that this item should animate its width when pressed, expanding its resting width by RemoteButtonGroup's expansionWidth delta while neighboring items shrink accordingly.

The animation needs touch actions, so it's skipped when the creation profile doesn't support them.

Returns
RemoteModifier

a RemoteModifier that animates the item's width when pressed

RemoteModifier.minWidth

fun RemoteModifier.minWidth(
    minWidth: RemoteDp = RemoteButtonGroupDefaults.MinWidth
): RemoteModifier

Sets the minimum width of this item, defaults to RemoteButtonGroupDefaults.MinWidth.

Parameters
minWidth: RemoteDp = RemoteButtonGroupDefaults.MinWidth

The minimum width to use for this item. Must be a positive constant.

Returns
RemoteModifier

a RemoteModifier that sets the minimum width of the item to minWidth

fun RemoteModifier.weight(weight: RemoteFloat): RemoteModifier

Size the element's width proportional to its weight relative to other weighted sibling elements in the RemoteButtonGroup.

Parameters
weight: RemoteFloat

The proportional width to give to this element, as a multiplier of the total available width. Must be a positive constant.

Returns
RemoteModifier

a RemoteModifier that sizes the element's width proportional to weight