CarIcon.Builder
class CarIcon.Builder
A builder of CarIcon.
Summary
Public constructors |
|---|
|
Returns a |
Builder(icon: IconCompat)Creates a |
Public functions |
|
|---|---|
CarIcon |
build()Constructs the |
CarIcon.Builder |
Sets the tint of the icon to the given |
Public constructors
Builder
Builder(carIcon: CarIcon)
Returns a Builder instance configured with the same data as the given CarIcon instance.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
Builder
Builder(icon: IconCompat)
Creates a Builder instance using the given IconCompat.
The following types are supported:
TYPE_URI is only supported in templates that explicitly allow it. In those cases, the appropriate APIs will be documented to indicate this.
For TYPE_URI, the URI's scheme must be SCHEME_CONTENT.
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.
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |
java.lang.NullPointerException |
if |
Public functions
setTint
fun setTint(tint: CarColor): CarIcon.Builder
Sets the tint of the icon to the given CarColor.
This tint overrides the tint set through setTint in the backing IconCompat with a CarColor tint. The tint set through setTint is not guaranteed to be applied if the CarIcon tint is not set.
The tint mode used to blend this color is SRC_IN.
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.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
| See also | |
|---|---|
CarColor |
|
setTintMode |