Suggestion.Builder
class Suggestion.Builder
A builder of Suggestion.
Summary
Public functions |
|
|---|---|
Suggestion |
build()Constructs the |
Suggestion.Builder |
setAction(action: PendingIntent)Sets the |
Suggestion.Builder |
Sets a suggestion image to display. |
Suggestion.Builder |
setIdentifier(identifier: String)Sets the suggestion identifier. |
Suggestion.Builder |
setSubtitle(subtitle: CharSequence)Sets the suggestion subtitle formatted for the user's current locale. |
Suggestion.Builder |
setTitle(title: CharSequence)Sets the suggestion title formatted for the user's current locale. |
Public functions
build
fun build(): Suggestion
Constructs the Suggestion defined by this builder.
| Throws | |
|---|---|
java.lang.IllegalStateException |
if any of the files are |
setAction
fun setAction(action: PendingIntent): Suggestion.Builder
Sets the PendingIntent for the suggestion action.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
setIcon
fun setIcon(icon: CarIcon): Suggestion.Builder
Sets a suggestion image to display.
Image Sizing Guidance
To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 128 x 128 dp bounding box. If the image exceeds this maximum size in either one of the dimensions, it will be scaled down to be centered inside the bounding box while preserving the aspect ratio. Icon images are expected to be tintable.See CarIcon for more details related to providing icon and image resources that work with different car screen pixel densities.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
setIdentifier
fun setIdentifier(identifier: String): Suggestion.Builder
Sets the suggestion identifier.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
setSubtitle
fun setSubtitle(subtitle: CharSequence): Suggestion.Builder
Sets the suggestion subtitle formatted for the user's current locale.
Spans are not supported in the input string and will be ignored.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
| See also | |
|---|---|
CarText |
setTitle
fun setTitle(title: CharSequence): Suggestion.Builder
Sets the suggestion title formatted for the user's current locale.
Spans are not supported in the input string and will be ignored.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
| See also | |
|---|---|
CarText |