Toggle
@CarProtocol
public final class Toggle
Represents a toggle that can have either a checked or unchecked state.
Toggles are allowed in Map and Pane templates from API >= 6. Old hosts may render bad UI if the toggles are added to hosts that don't support them.
Summary
Nested types |
|---|
public final class Toggle.BuilderA builder of |
public interface Toggle.OnCheckedChangeListenerA listener for handling checked state change events. |
Public methods |
|
|---|---|
boolean |
|
@NonNull OnCheckedChangeDelegate |
Returns the |
int |
hashCode() |
boolean |
Returns |
boolean |
@RequiresCarApi(value = 5)Returns |
@NonNull String |
toString() |
Public methods
getOnCheckedChangeDelegate
public @NonNull OnCheckedChangeDelegate getOnCheckedChangeDelegate()
Returns the OnCheckedChangeDelegate that is called when the checked state of the Toggle is changed.
isEnabled
@RequiresCarApi(value = 5)
public boolean isEnabled()
Returns true if the toggle is enabled.