GridItem.Builder

public static final class GridItem.Builder
extends Object

java.lang.Object
   ↳ androidx.car.app.model.GridItem.Builder


A builder of GridItem.

Summary

Public constructors

Builder()

Returns an empty GridItem.Builder instance.

Public methods

GridItem build()

Constructs the GridItem defined by this builder.

GridItem.Builder setImage(CarIcon image, int imageType)

Sets an image to show in the grid item with the given imageType.

GridItem.Builder setImage(CarIcon image)

Sets an image to show in the grid item with the default size GridItem.IMAGE_TYPE_LARGE.

GridItem.Builder setLoading(boolean isLoading)

Sets whether the item is in a loading state.

GridItem.Builder setOnClickListener(OnClickListener onClickListener)

Sets the OnClickListener to be called back when the grid item is clicked, or null to make the grid item non-clickable.

GridItem.Builder setText(CharSequence text)

Sets a secondary text string to the grid item that is displayed below the title.

GridItem.Builder setText(CarText text)

Sets a secondary text string to the grid item that is displayed below the title, with support for multiple length variants.

GridItem.Builder setTitle(CharSequence title)

Sets the title of the GridItem.

GridItem.Builder setTitle(CarText title)

Sets the title of the GridItem, with support for multiple length variants.,

Only DistanceSpans and DurationSpans are supported in the input string.

Inherited methods