ButtonGroupScope


Button group scope used to indicate a Modifier.weight of a child element.

Summary

Public functions

Modifier

Specifies the interaction source to use with this item.

Cmn
Modifier
Modifier.weight(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float
)

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

Cmn

Public functions

animateWidth

fun Modifier.animateWidth(interactionSource: InteractionSource): Modifier

Specifies the interaction source to use with this item. This is used to listen to events and animate growing the pressed button and shrink the neighbor(s).

Parameters
interactionSource: InteractionSource

the InteractionSource that button group will observe.

fun Modifier.weight(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float
): Modifier

Size the element's width proportional to its weight relative to other weighted sibling elements in the ButtonGroup. The parent will divide the horizontal space remaining after measuring unweighted child elements and distribute it according to this weight.

Parameters
weight: @FloatRange(from = 0.0, fromInclusive = false) Float

The proportional width to give to this element, as related to the total of all weighted siblings. Must be positive.