CompactChip.Builder

Added in 1.1.0
Deprecated in 1.2.0

class CompactChip.Builder : LayoutElementBuilders.LayoutElement.Builder


Builder class for androidx.wear.tiles.material.CompactChip.

Summary

Public constructors

Builder(
    context: Context,
    text: String,
    clickable: ModifiersBuilders.Clickable,
    deviceParameters: DeviceParametersBuilders.DeviceParameters
)

Creates a builder for the CompactChip with associated action and the given text

Public functions

CompactChip

Constructs and returns CompactChip with the provided content and look.

CompactChip.Builder

Sets the colors for the CompactChip.

Public constructors

Builder

Added in 1.1.0
Deprecated in 1.2.0
Builder(
    context: Context,
    text: String,
    clickable: ModifiersBuilders.Clickable,
    deviceParameters: DeviceParametersBuilders.DeviceParameters
)

Creates a builder for the CompactChip with associated action and the given text

Parameters
context: Context

The application's context.

text: String

The text to be displayed in this compact chip.

clickable: ModifiersBuilders.Clickable

Associated androidx.wear.tiles.ModifiersBuilders.Clickable for click events. When the CompactChip is clicked it will fire the associated action.

deviceParameters: DeviceParametersBuilders.DeviceParameters

The device parameters used for styling text.

Public functions

build

Added in 1.1.0
Deprecated in 1.2.0
fun build(): CompactChip

Constructs and returns CompactChip with the provided content and look.

setChipColors

Added in 1.1.0
Deprecated in 1.2.0
fun setChipColors(chipColors: ChipColors): CompactChip.Builder

Sets the colors for the CompactChip. If set, getBackgroundColor will be used for the background of the button and getContentColor for the text. If not set, COMPACT_PRIMARY_COLORS will be used.