TitleChip.Builder
class TitleChip.Builder
Builder class for TitleChip.
Summary
Public constructors |
|---|
Builder(Creates a builder for the |
Public functions |
|
|---|---|
TitleChip |
build()Constructs and returns |
TitleChip.Builder |
setChipColors(chipColors: ChipColors)Sets the colors for the |
TitleChip.Builder |
setContentDescription(contentDescription: CharSequence)Sets the static content description for the |
TitleChip.Builder |
setContentDescription(contentDescription: TypeBuilders.StringProp)Sets the content description for the |
TitleChip.Builder |
setHorizontalAlignment(horizontalAlignment: Int)Sets the horizontal alignment in the chip. |
TitleChip.Builder |
setIconContent(imageResourceId: String)Sets the icon for the |
TitleChip.Builder |
Sets the width of |
TitleChip.Builder |
Sets the width of |
Public constructors
Builder
Builder(
context: Context,
text: String,
clickable: ModifiersBuilders.Clickable,
deviceParameters: DeviceParametersBuilders.DeviceParameters
)
Creates a builder for the TitleChip with associated action and the given text
| Parameters | |
|---|---|
context: Context |
The application's context. |
text: String |
The text to be displayed in this title chip. Text will be displayed in 1 line and truncated if it doesn't fit. |
clickable: ModifiersBuilders.Clickable |
Associated |
deviceParameters: DeviceParametersBuilders.DeviceParameters |
The device parameters used for styling text. |
Public functions
build
fun build(): TitleChip
Constructs and returns TitleChip with the provided content and look.
setChipColors
fun setChipColors(chipColors: ChipColors): TitleChip.Builder
Sets the colors for the TitleChip. If set, getBackgroundColor will be used for the background of the button and getContentColor for the text. If not set, TITLE_PRIMARY_COLORS will be used.
setContentDescription
fun setContentDescription(contentDescription: CharSequence): TitleChip.Builder
Sets the static content description for the TitleChip. It is highly recommended to provide this for chip containing an icon.
setContentDescription
fun setContentDescription(contentDescription: TypeBuilders.StringProp): TitleChip.Builder
Sets the content description for the TitleChip. It is highly recommended to provide this for chip containing an icon.
While this field is statically accessible from 1.0, it's only bindable since version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).
setHorizontalAlignment
fun setHorizontalAlignment(horizontalAlignment: Int): TitleChip.Builder
Sets the horizontal alignment in the chip. If not set, content will be centered.
setIconContent
fun setIconContent(imageResourceId: String): TitleChip.Builder
Sets the icon for the TitleChip. Provided icon will be tinted to the given content color from ChipColors. This icon should be image with chosen alpha channel that can be tinted.
setWidth
fun setWidth(width: DimensionBuilders.ContainerDimension): TitleChip.Builder
Sets the width of TitleChip. If not set, default value will be set to fill the screen.