Toggle

@CarProtocol
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

A builder of Toggle.

A listener for handling checked state change events.

Public functions

Boolean
equals(other: Any?)
OnCheckedChangeDelegate

Returns the OnCheckedChangeDelegate that is called when the checked state of the Toggle is changed.

Int
Boolean

Returns true if the toggle is checked.

Boolean
@RequiresCarApi(value = 5)
isEnabled()

Returns true if the toggle is enabled.

String

Public functions

equals

Added in 1.4.0-rc02
fun equals(other: Any?): Boolean

getOnCheckedChangeDelegate

Added in 1.0.0
fun getOnCheckedChangeDelegate(): OnCheckedChangeDelegate

Returns the OnCheckedChangeDelegate that is called when the checked state of the Toggle is changed.

hashCode

Added in 1.4.0-rc02
fun hashCode(): Int

isChecked

Added in 1.0.0
fun isChecked(): Boolean

Returns true if the toggle is checked.

isEnabled

Added in 1.3.0
@RequiresCarApi(value = 5)
fun isEnabled(): Boolean

Returns true if the toggle is enabled.

toString

Added in 1.4.0-rc02
fun toString(): String