public final class

SignInTemplate.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.model.signin.SignInTemplate.Builder

Overview

A builder of SignInTemplate.

Summary

Constructors
publicBuilder(SignInTemplate.SignInMethod signInMethod)

Returns a SignInTemplate.Builder instance.

Methods
public SignInTemplate.BuilderaddAction(Action action)

Adds an Action to display alongside the sign-in content.

public SignInTemplatebuild()

Constructs the template defined by this builder.

public SignInTemplate.BuildersetActionStrip(ActionStrip actionStrip)

Sets the ActionStrip for this template.

public SignInTemplate.BuildersetAdditionalText(java.lang.CharSequence additionalText)

Sets additional text, such as disclaimers, links to terms of services, to show in the template.

public SignInTemplate.BuildersetHeaderAction(Action headerAction)

Sets the Action that will be displayed in the header of the template.

public SignInTemplate.BuildersetInstructions(java.lang.CharSequence instructions)

Sets the text to show as instructions of the template.

public SignInTemplate.BuildersetLoading(boolean isLoading)

Sets whether the template is in a loading state.

public SignInTemplate.BuildersetTitle(java.lang.CharSequence title)

Sets the title of the template.

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

Constructors

public Builder(SignInTemplate.SignInMethod signInMethod)

Returns a SignInTemplate.Builder instance.

Parameters:

signInMethod: the sign-in method to use in this template

Methods

public SignInTemplate.Builder setLoading(boolean isLoading)

Sets whether the template is in a loading state.

If set to true, the UI will display a loading indicator instead of the SignInTemplate.SignInMethod. The caller is expected to call Screen.invalidate() once loading is complete.

public SignInTemplate.Builder setHeaderAction(Action headerAction)

Sets the Action that will be displayed in the header of the template.

Unless set with this method, the template will not have a header action.

Requirements

This template only supports either one of Action.APP_ICON and Action.BACK as a header Action.

public SignInTemplate.Builder setActionStrip(ActionStrip actionStrip)

Sets the ActionStrip for this template.

Unless set with this method, the template will not have an action strip.

Requirements

This template allows up to 2 Actions in its ActionStrip. Of the 2 allowed Actions, one of them can contain a title as set via . Otherwise, only Actions with icons are allowed.

public SignInTemplate.Builder addAction(Action action)

Adds an Action to display alongside the sign-in content.

Requirements

This template allows up to 2 Actions in its body, and they must use a ParkedOnlyOnClickListener.

Each action's title color can be customized with ForegroundCarColorSpan instances. Any other span is not supported.

public SignInTemplate.Builder setTitle(java.lang.CharSequence title)

Sets the title of the template.

Unless set with this method, the template will not have a title.

Only DistanceSpans and DurationSpans are supported in the input string.

public SignInTemplate.Builder setInstructions(java.lang.CharSequence instructions)

Sets the text to show as instructions of the template.

Unless set with this method, the template will not have instructions.

DistanceSpan, DurationSpan, and ForegroundCarColorSpan are supported in the input string.

See also: for details on text handling and span support.

public SignInTemplate.Builder setAdditionalText(java.lang.CharSequence additionalText)

Sets additional text, such as disclaimers, links to terms of services, to show in the template.

Unless set with this method, the template will not have additional text.

ClickableSpan, DistanceSpan, and DurationSpan are supported in the input string.

See also: CarText

public SignInTemplate build()

Constructs the template defined by this builder.

Requirements

Either a header Action or the title must be set.