Google is committed to advancing racial equity for Black communities. See how.

CarIcon.Builder

public static class CarIcon.Builder
extends Object

java.lang.Object
   ↳ com.google.android.libraries.car.app.model.CarIcon.Builder


A builder of CarIcon.

Summary

Public methods

CarIcon build()

Constructs the CarIcon defined by this builder.

CarIcon.Builder setIcon(CarIcon carIcon)

Configures the builder with the same icon and tint as the given CarIcon.

CarIcon.Builder setTint(CarColor tint)

Sets the tint of the icon to the given CarColor.

Inherited methods

Public methods

build

public CarIcon build ()

Constructs the CarIcon defined by this builder.

Returns
CarIcon

setIcon

public CarIcon.Builder setIcon (CarIcon carIcon)

Configures the builder with the same icon and tint as the given CarIcon.

Parameters
carIcon CarIcon

Returns
CarIcon.Builder

Throws
NullPointerException if carIcon is null.

setTint

public CarIcon.Builder setTint (CarColor tint)

Sets the tint of the icon to the given CarColor.

This tint overrides the tint set through IconCompat.setTint(int) in the backing IconCompat with a CarColor tint.The tint set through IconCompat.setTint(int) is not guaranteed to be applied if the CarIcon tint is not set.

The tint mode used to blend this color is PorterDuff.Mode.SRC_IN.

If set to null, then no tint will be applied to the icon.

By default, no tint is set unless one is specified with this method.

Parameters
tint CarColor

Returns
CarIcon.Builder