ToolbarItemIndication

class ToolbarItemIndication(val shape: Shape, val rippleColor: Color = Color.Unspecified)

How a toolbar item shows that it is pressed, hovered, focused or selected: the shape its ripple, hover state layer and selection highlight are all clipped to, and the rippleColor of that ripple.

One value serves both bars — NutrientMainToolbar(itemIndication = …) and NutrientContextualToolbar(itemIndication = …) — and reaches every NutrientToolbarItemButton inside them through LocalToolbarItemIndication: the SDK's own items, a host's slot content and the contextual bar's submenu sheet alike. The overflow ⋮ menu is a Material DropdownMenu and keeps Material's own indication.

NutrientMainToolbar(
coordinator,
shape = RoundedCornerShape(28.dp),
itemIndication = ToolbarItemIndication(shape = CircleShape, rippleColor = Color.White),
)

Constructors

Link copied to clipboard
constructor(shape: Shape, rippleColor: Color = Color.Unspecified)

Types

Link copied to clipboard
object Companion

Holder for the shared Default value.

Properties

Link copied to clipboard

The ripple's color; Color.Unspecified leaves it to Material's ripple default.

Link copied to clipboard

The shape the item's ripple, state layer and selection highlight are clipped to.

Functions

Link copied to clipboard
fun copy(shape: Shape = this.shape, rippleColor: Color = this.rippleColor): ToolbarItemIndication

A copy with the given values replaced, for overriding one field of a default: Default.copy(shape = CircleShape).

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Two indications are equal when their shape and rippleColor are.

Link copied to clipboard
open override fun hashCode(): Int

Consistent with equals: derived from shape and rippleColor.

Link copied to clipboard
open override fun toString(): String

The class name with both fields, for logs and test failure messages.