CarIconStyle
@CarProtocol
class CarIconStyle
Defines the visual styling applied to a CarIcon, including tinting behavior and geometric shapes.
In general, icon styling falls into two categories:
- Tinted: Styled with
TINTED, which instructs the host vehicle system to automatically theme-tint the asset withDEFAULTor applies an explicit solidCarColortint configured viasetTint. - Original (Not Tinted): Styled with
ORIGINAL, which preserves the icon's original colors without allowing host-side tinting (e.g., user avatars, media album art, photos, or un-tinted brand graphics).
Summary
Nested types |
|---|
class CarIconStyle.BuilderA builder of |
Constants |
|
|---|---|
const CarIconStyle |
Visual styling for icons that should retain their original colors without allowing host-side tinting. |
const CarIconStyle |
Visual styling for icons that should be tinted. |
Public functions |
|
|---|---|
Boolean |
|
Shape? |
@RequiresCarApi(value = 9)Returns the |
CarColor? |
getTint()Returns the explicit |
Int |
hashCode() |
String |
toString() |
Constants
ORIGINAL
const val ORIGINAL: CarIconStyle
Visual styling for icons that should retain their original colors without allowing host-side tinting.
Instructs the host vehicle system to preserve the full original colors of the image without host tinting interference. Use this for assets such as user avatars, media album art, photos, or un-tinted logos.
TINTED
const val TINTED: CarIconStyle
Visual styling for icons that should be tinted.
By default, this instructs the host to automatically tint the icon or allows the dev to provide an explicit custom tint. To apply an explicit custom tint color use Builder with TINTED and call setTint.
Public functions
getShape
@RequiresCarApi(value = 9)
@ExperimentalCarApi
fun getShape(): Shape?
Returns the Shape defined in this style, or null if none is set.
getTint
fun getTint(): CarColor?
Returns the explicit CarColor tint defined in this style (such as DEFAULT for auto-tinting or a custom tint), or null if no tint is applied.