CarIconStyle.Builder


public final class CarIconStyle.Builder


A builder of CarIconStyle.

Summary

Public constructors

Creates a builder for a custom CarIconStyle based on an existing base style contract.

Public methods

@NonNull CarIconStyle

Constructs the CarIconStyle defined by this builder.

@NonNull CarIconStyle.Builder

Sets the geometric Shape boundary to crop or frame the icon graphic.

@NonNull CarIconStyle.Builder

Sets an explicit custom solid CarColor tint for single-color assets.

Public constructors

Builder

Added in 1.9.0-alpha02
public Builder(@NonNull CarIconStyle baseStyle)

Creates a builder for a custom CarIconStyle based on an existing base style contract.

Parameters
@NonNull CarIconStyle baseStyle

The base style contract to inherit from, typically TINTED or ORIGINAL.

Public methods

build

Added in 1.9.0-alpha02
public @NonNull CarIconStyle build()

Constructs the CarIconStyle defined by this builder.

setShape

Added in 1.9.0-alpha02
@RequiresCarApi(value = 9)
@ExperimentalCarApi
public @NonNull CarIconStyle.Builder setShape(@NonNull Shape shape)

Sets the geometric Shape boundary to crop or frame the icon graphic.

setTint

Added in 1.9.0-alpha02
public @NonNull CarIconStyle.Builder setTint(@NonNull CarColor tint)

Sets an explicit custom solid CarColor tint for single-color assets.

This will apply a solid color tint rather than leaving the image as-is. Use CarIconStyle.Builder(CarIconStyle.ORIGINAL)` to create an un-tinted style