public final class

TitleChip.Builder

extends java.lang.Object

implements LayoutElementBuilders.LayoutElement.Builder

 java.lang.Object

↳androidx.wear.tiles.material.TitleChip.Builder

Overview

Builder class for TitleChip.

Summary

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

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

Methods
public TitleChipbuild()

Constructs and returns TitleChip with the provided content and look.

public TitleChip.BuildersetChipColors(ChipColors chipColors)

Sets the colors for the TitleChip.

public TitleChip.BuildersetHorizontalAlignment(int horizontalAlignment)

Sets the horizontal alignment in the chip.

public TitleChip.BuildersetWidth(DimensionBuilders.ContainerDimension width)

Sets the width of TitleChip.

public TitleChip.BuildersetWidth(float width)

Sets the width of TitleChip.

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 TitleChip with associated action and the given text

Parameters:

context: The application's context.
text: The text to be displayed in this title chip. Text will be displayed in 1 line and truncated if it doesn't fit.
clickable: Associated for click events. When the TitleChip is clicked it will fire the associated action.
deviceParameters: The device parameters used for styling text.

Methods

public TitleChip.Builder setChipColors(ChipColors chipColors)

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

public TitleChip.Builder setHorizontalAlignment(int horizontalAlignment)

Sets the horizontal alignment in the chip. If not set, content will be centered.

Sets the width of TitleChip. If not set, default value will be set to fill the screen.

public TitleChip.Builder setWidth(float width)

Sets the width of TitleChip. If not set, default value will be set to fill the screen.

public TitleChip build()

Constructs and returns TitleChip with the provided content and look.