public final class

CarIcon.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.model.CarIcon.Builder

Overview

A builder of CarIcon.

Summary

Constructors
publicBuilder(CarIcon carIcon)

Returns a CarIcon.Builder instance configured with the same data as the given CarIcon instance.

publicBuilder(IconCompat icon)

Creates a CarIcon.Builder instance using the given IconCompat.

Methods
public CarIconbuild()

Constructs the CarIcon defined by this builder.

public CarIcon.BuildersetTint(CarColor tint)

Sets the tint of the icon to the given CarColor.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(IconCompat icon)

Creates a CarIcon.Builder instance using the given IconCompat.

The following types are supported:

IconCompat.TYPE_URI is only supported in templates that explicitly allow it. In those cases, the appropriate APIs will be documented to indicate this.

For IconCompat.TYPE_URI, the URI's scheme must be .

If the icon image is loaded from URI, it may be cached on the host side. Changing the contents of the URI will result in the host showing a stale image.

public Builder(CarIcon carIcon)

Returns a CarIcon.Builder instance configured with the same data as the given CarIcon instance.

Methods

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 .

Depending on contrast requirements, capabilities of the vehicle screens, or other factors, the color may be ignored by the host or overridden by the vehicle system.

See also: CarColor, android.graphics.drawable.Drawable

public CarIcon build()

Constructs the CarIcon defined by this builder.