public final class

ImageReference.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.cluster.navigation.ImageReference.Builder

Overview

Builder for creating an ImageReference.

Summary

Constructors
publicBuilder()

Methods
public ImageReferencebuild()

Returns a ImageReference built with the provided information.

public ImageReference.BuildersetContentUri(java.lang.String contentUri)

Sets a 'content://' style URI

public ImageReference.BuildersetIsTintable(boolean isTintable)

Sets whether this image is "tintable" or not.

public ImageReference.BuildersetOriginalSize(int width, int height)

Sets the aspect ratio of this image, expressed as with and height sizes.

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

Constructors

public Builder()

Methods

public ImageReference.Builder setContentUri(java.lang.String contentUri)

Sets a 'content://' style URI

Returns:

this object for chaining

public ImageReference.Builder setOriginalSize(int width, int height)

Sets the aspect ratio of this image, expressed as with and height sizes. Both dimensions must be greater than 0.

Returns:

this object for chaining

public ImageReference.Builder setIsTintable(boolean isTintable)

Sets whether this image is "tintable" or not. An image is "tintable" when all its content is defined in its alpha-channel, designed to be colorized (e.g. using image composition). If this method is not used, images will be non "tintable" by default.

Returns:

this object for chaining

public ImageReference build()

Returns a ImageReference built with the provided information. Calling ImageReference.Builder.setContentUri(String) and ImageReference.Builder.setOriginalSize(int, int) before calling this method is mandatory.

Returns:

an ImageReference instance