public final class

ActionsConstraints.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.model.constraints.ActionsConstraints.Builder

Overview

A builder of ActionsConstraints.

Summary

Constructors
publicBuilder()

Returns an empty ActionsConstraints.Builder instance.

publicBuilder(ActionsConstraints constraints)

Returns a new builder that contains the same data as the given ActionsConstraints instance.

Methods
public ActionsConstraints.BuilderaddAllowedActionType(int actionType)

Adds an action type to the set of allowed types.

public ActionsConstraints.BuilderaddDisallowedActionType(int actionType)

Adds an action type to the set of disallowed types.

public ActionsConstraints.BuilderaddRequiredActionType(int actionType)

Adds an action type to the set of required types.

public ActionsConstraintsbuild()

Returns an ActionsConstraints instance defined by this builder.

public ActionsConstraints.BuildersetMaxActions(int maxActions)

Sets the maximum number of actions allowed.

public ActionsConstraints.BuildersetMaxCustomTitles(int maxCustomTitles)

Sets the maximum number of actions with custom titles allowed.

public ActionsConstraints.BuildersetMaxPrimaryActions(int maxPrimaryActions)

Sets the maximum number of primary actions allowed.

public ActionsConstraints.BuildersetOnClickListenerAllowed(boolean onClickListenerAllowed)

Set true if all actions can have an OnClickDelegate.

public ActionsConstraints.BuildersetRequireActionBackgroundColor(boolean requireActionBackgroundColor)

Set true if all non-standard actions must have a background CarColor.

public ActionsConstraints.BuildersetRequireActionIcons(boolean requireActionIcons)

Set true if all non-standard actions must have an CarIcon.

public ActionsConstraints.BuildersetRestrictBackgroundColorToPrimaryAction(boolean restrictBackgroundColorToPrimaryAction)

Set true if background color can only be set for FLAG_PRIMARY actions.

public ActionsConstraints.BuildersetTitleTextConstraints(CarTextConstraints carTextConstraints)

Sets the CarTextConstraints for the title.

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

Constructors

public Builder()

Returns an empty ActionsConstraints.Builder instance.

public Builder(ActionsConstraints constraints)

Returns a new builder that contains the same data as the given ActionsConstraints instance.

Methods

public ActionsConstraints.Builder setMaxActions(int maxActions)

Sets the maximum number of actions allowed.

public ActionsConstraints.Builder setRequireActionIcons(boolean requireActionIcons)

Set true if all non-standard actions must have an CarIcon.

public ActionsConstraints.Builder setRequireActionBackgroundColor(boolean requireActionBackgroundColor)

Set true if all non-standard actions must have a background CarColor.

public ActionsConstraints.Builder setOnClickListenerAllowed(boolean onClickListenerAllowed)

Set true if all actions can have an OnClickDelegate.

public ActionsConstraints.Builder setRestrictBackgroundColorToPrimaryAction(boolean restrictBackgroundColorToPrimaryAction)

Set true if background color can only be set for FLAG_PRIMARY actions.

public ActionsConstraints.Builder setMaxPrimaryActions(int maxPrimaryActions)

Sets the maximum number of primary actions allowed.

public ActionsConstraints.Builder setMaxCustomTitles(int maxCustomTitles)

Sets the maximum number of actions with custom titles allowed.

public ActionsConstraints.Builder setTitleTextConstraints(CarTextConstraints carTextConstraints)

Sets the CarTextConstraints for the title.

public ActionsConstraints.Builder addRequiredActionType(int actionType)

Adds an action type to the set of required types.

public ActionsConstraints.Builder addDisallowedActionType(int actionType)

Adds an action type to the set of disallowed types.

public ActionsConstraints.Builder addAllowedActionType(int actionType)

Adds an action type to the set of allowed types.

public ActionsConstraints build()

Returns an ActionsConstraints instance defined by this builder.