Added in API level 30

ToggleRangeTemplate


class ToggleRangeTemplate : ControlTemplate

A template for a Control supporting toggling and a range.

Summary

Inherited constants
Int TYPE_ERROR

Type identifier of the template returned by getErrorTemplate().
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_NO_TEMPLATE

Type identifier of ControlTemplate.getNoTemplateObject.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_RANGE

Type identifier of RangeTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_STATELESS

Type identifier of StatelessTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_TEMPERATURE

Type identifier of TemperatureControlTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_THUMBNAIL

Type identifier of ThumbnailTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_TOGGLE

Type identifier of ToggleTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Int TYPE_TOGGLE_RANGE

Type identifier of ToggleRangeTemplate.
Value is android.service.controls.templates.ControlTemplate#TYPE_ERROR, android.service.controls.templates.ControlTemplate#TYPE_NO_TEMPLATE, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE, android.service.controls.templates.ControlTemplate#TYPE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_THUMBNAIL, android.service.controls.templates.ControlTemplate#TYPE_TOGGLE_RANGE, android.service.controls.templates.ControlTemplate#TYPE_TEMPERATURE, or android.service.controls.templates.ControlTemplate#TYPE_STATELESS

Public constructors
ToggleRangeTemplate(templateId: String, button: ControlButton, range: RangeTemplate)

Constructs a new ToggleRangeTemplate.

ToggleRangeTemplate(templateId: String, checked: Boolean, actionDescription: CharSequence, range: RangeTemplate)

Constructs a new ToggleRangeTemplate.

Inherited functions
ControlTemplate getErrorTemplate()

ControlTemplate getNoTemplateObject()

Get a singleton ControlTemplate, which supports no direct user input. Used by Control.StatelessBuilder when there is no known state. Can also be used in Control.StatefulBuilder for conveying information to a user about the Control but direct user interaction is not desired. Since this template has no corresponding ControlAction, any user interaction will launch the Control.getAppIntent().

String getTemplateId()

Public constructors

ToggleRangeTemplate

Added in API level 30
ToggleRangeTemplate(
    templateId: String,
    button: ControlButton,
    range: RangeTemplate)

Constructs a new ToggleRangeTemplate.

Parameters
templateId String: the identifier for this template. This value cannot be null.
button ControlButton: a ControlButton to use for the toggle interface This value cannot be null.
range RangeTemplate: a RangeTemplate to use for the range interface This value cannot be null.

ToggleRangeTemplate

Added in API level 30
ToggleRangeTemplate(
    templateId: String,
    checked: Boolean,
    actionDescription: CharSequence,
    range: RangeTemplate)

Constructs a new ToggleRangeTemplate.

Parameters
templateId String: the identifier for this template. This value cannot be null.
checked Boolean: true if the toggle should be rendered as active.
actionDescription CharSequence: action description for the button. This value cannot be null.
range RangeTemplate: RangeTemplate to use for the range interface This value cannot be null.

Public methods

getActionDescription

Added in API level 30
fun getActionDescription(): CharSequence
Return
CharSequence This value cannot be null.

getRange

Added in API level 30
fun getRange(): RangeTemplate
Return
RangeTemplate This value cannot be null.

getTemplateType

Added in API level 30
fun getTemplateType(): Int

isChecked

Added in API level 30
fun isChecked(): Boolean