TitleChip
class TitleChip : LayoutElementBuilders.LayoutElement
Tiles component TitleChip that represents clickable object with the text.
The Title Chip is Stadium shaped object with a larger height then standard Chip and it will take one line of text of TYPOGRAPHY_TITLE2 style.
The recommended set of ChipColors styles can be obtained from ChipDefaults, e.g. TITLE_PRIMARY_COLORS to get a color scheme for a primary TitleChip.
When accessing the contents of a container for testing, note that this element can't be simply casted back to the original type, i.e.:
TitleChip chip = new TitleChip... Box box = new Box.Builder().addContent(chip).build(); TitleChip myChip = (TitleChip) box.getContents().get(0);
To be able to get TitleChip object from any layout element, fromLayoutElement method should be used, i.e.:
TitleChip myChip = TitleChip.fromLayoutElement(box.getContents().get(0));
| See also | |
|---|---|
setContent |
if this TitleChip is used inside of |
Summary
Nested types |
|---|
|
Builder class for |
Public functions |
|
|---|---|
java-static TitleChip? |
Returns TitleChip object from the given androidx.wear.tiles.LayoutElementBuilders.LayoutElement (e.g. one retrieved from a container's content with |
ChipColors |
Returns chip color of this Chip. |
ModifiersBuilders.Clickable |
Returns click event action associated with this Chip. |
Int |
Returns the horizontal alignment of the content in this Chip. |
String |
Returns text content of this Chip. |
DimensionBuilders.ContainerDimension |
Returns width of this Chip. |
Public functions
java-static funfromLayoutElement(element: LayoutElementBuilders.LayoutElement): TitleChip?
Returns TitleChip object from the given androidx.wear.tiles.LayoutElementBuilders.LayoutElement (e.g. one retrieved from a container's content with container.getContents().get(index)) if that element can be converted to TitleChip. Otherwise, it will return null.
fungetClickable(): ModifiersBuilders.Clickable
Returns click event action associated with this Chip.