Added in API level 30

ToggleRangeTemplate


class ToggleRangeTemplate : ControlTemplate
kotlin.Any
   ↳ android.service.controls.templates.ControlTemplate
   ↳ android.service.controls.templates.ToggleRangeTemplate

A template for a Control supporting toggling and a range.

Summary

Inherited constants
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.

Public methods
CharSequence

RangeTemplate

Int

Boolean

Inherited functions

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
Return
Int ControlTemplate.TYPE_TOGGLE_RANGE

isChecked

Added in API level 30
fun isChecked(): Boolean