public final class

Toggle.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.model.Toggle.Builder

Overview

A builder of Toggle.

Summary

Constructors
publicBuilder(Toggle.OnCheckedChangeListener onCheckedChangeListener)

Returns a new instance of a Toggle.Builder with the given Toggle.OnCheckedChangeListener.

Methods
public Togglebuild()

Constructs the Toggle defined by this builder.

public Toggle.BuildersetChecked(boolean checked)

Sets the initial checked state for Toggle.

public Toggle.BuildersetEnabled(boolean enabled)

Sets the initial enabled state for Toggle.

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

Constructors

public Builder(Toggle.OnCheckedChangeListener onCheckedChangeListener)

Returns a new instance of a Toggle.Builder with the given Toggle.OnCheckedChangeListener.

Note that the listener relates to UI events and will be executed on the main thread using .

Methods

public Toggle.Builder setChecked(boolean checked)

Sets the initial checked state for Toggle.

The default state of a Toggle is unchecked.

public Toggle.Builder setEnabled(boolean enabled)

Sets the initial enabled state for Toggle.

The default state of a Toggle is enabled.

public Toggle build()

Constructs the Toggle defined by this builder.