public final class

CompactChip.Builder

extends java.lang.Object

implements LayoutElementBuilders.LayoutElement.Builder

 java.lang.Object

↳androidx.wear.tiles.material.CompactChip.Builder

Overview

Builder class for CompactChip.

Summary

Constructors
publicBuilder(Context context, java.lang.String text, ModifiersBuilders.Clickable clickable, DeviceParametersBuilders.DeviceParameters deviceParameters)

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

Methods
public CompactChipbuild()

Constructs and returns CompactChip with the provided content and look.

public CompactChip.BuildersetChipColors(ChipColors chipColors)

Sets the colors for the CompactChip.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(Context context, java.lang.String text, ModifiersBuilders.Clickable clickable, DeviceParametersBuilders.DeviceParameters deviceParameters)

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

Parameters:

context: The application's context.
text: The text to be displayed in this compact chip. It shouldn't contain more than 9 characters. Any extra characters will be deleted.
clickable: Associated ModifiersBuilders.Clickable for click events. When the CompactChip is clicked it will fire the associated action.
deviceParameters: The device parameters used for styling text.

Methods

public CompactChip.Builder setChipColors(ChipColors chipColors)

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

public CompactChip build()

Constructs and returns CompactChip with the provided content and look.