ToggleRangeTemplate

public final class ToggleRangeTemplate
extends ControlTemplate

java.lang.Object
   ↳ 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(String templateId, ControlButton button, RangeTemplate range)

Constructs a new ToggleRangeTemplate.

ToggleRangeTemplate(String templateId, boolean checked, CharSequence actionDescription, RangeTemplate range)

Constructs a new ToggleRangeTemplate.

Public methods

CharSequence getActionDescription()
RangeTemplate getRange()
int getTemplateType()

The template type associated with this class.

boolean isChecked()

Inherited methods

Public constructors

ToggleRangeTemplate

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

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
public ToggleRangeTemplate (String templateId, 
                boolean checked, 
                CharSequence actionDescription, 
                RangeTemplate range)

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.

See also:

Public methods

getActionDescription

Added in API level 30
public CharSequence getActionDescription ()

Returns
CharSequence This value cannot be null.

getRange

Added in API level 30
public RangeTemplate getRange ()

Returns
RangeTemplate This value cannot be null.

getTemplateType

Added in API level 30
public int getTemplateType ()

The template type associated with this class.

Returns
int ControlTemplate#TYPE_TOGGLE_RANGE

isChecked

Added in API level 30
public boolean isChecked ()

Returns
boolean