TitleChip.Builder
public final class TitleChip.Builder implements LayoutElementBuilders.LayoutElement.Builder
Builder class for TitleChip
.
Summary
Public constructors |
---|
Creates a builder for the |
Public methods |
|
---|---|
@NonNull TitleChip |
Constructs and returns |
@NonNull TitleChip.Builder |
Sets the colors for the |
@NonNull TitleChip.Builder |
Sets the horizontal alignment in the chip. |
@NonNull TitleChip.Builder |
Sets the width of |
@NonNull TitleChip.Builder |
Sets the width of |
Public constructors
publicBuilder(
@NonNull Context context,
@NonNull String text,
@NonNull ModifiersBuilders.Clickable clickable,
@NonNull DeviceParametersBuilders.DeviceParameters deviceParameters
)
Creates a builder for the TitleChip
with associated action and the given text
Parameters | |
---|---|
@NonNull Context context |
The application's context. |
@NonNull String text |
The text to be displayed in this title chip. Text will be displayed in 1 line and truncated if it doesn't fit. |
@NonNull ModifiersBuilders.Clickable clickable |
Associated Clickable for click events. When the TitleChip is clicked it will fire the associated action. |
@NonNull DeviceParametersBuilders.DeviceParameters deviceParameters |
The device parameters used for styling text. |
Public methods
public @NonNull TitleChipbuild()
Constructs and returns TitleChip
with the provided content and look.
public @NonNull TitleChip.BuildersetChipColors(@NonNull ChipColors chipColors)
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.
public @NonNull TitleChip.BuildersetHorizontalAlignment(int horizontalAlignment)
Sets the horizontal alignment in the chip. If not set, content will be centered.
public @NonNull TitleChip.BuildersetWidth(@NonNull DimensionBuilders.ContainerDimension width)
Sets the width of TitleChip
. If not set, default value will be set to fill the screen.