public
final
class
ToggleTemplate
extends ControlTemplate
java.lang.Object | ||
↳ | android.service.controls.templates.ControlTemplate | |
↳ | android.service.controls.templates.ToggleTemplate |
A template for a Control
with a single button that can be toggled between two states.
The states for the toggle correspond to the states in ControlButton#isChecked()
.
An action on this template will originate a BooleanAction
to change that state.
See also:
Inherited constants |
---|
Public constructors | |
---|---|
ToggleTemplate(String templateId, ControlButton button)
|
Public methods | |
---|---|
CharSequence
|
getContentDescription()
|
int
|
getTemplateType()
The |
boolean
|
isChecked()
|
Inherited methods | |
---|---|
public ToggleTemplate (String templateId, ControlButton button)
Parameters | |
---|---|
templateId |
String : the identifier for this template object
This value cannot be null . |
button |
ControlButton : a ControlButton that can show the current state and toggle it
This value cannot be null . |
public CharSequence getContentDescription ()
Returns | |
---|---|
CharSequence |
This value cannot be null . |
public int getTemplateType ()
The TemplateType
associated with this class.
Returns | |
---|---|
int |
ControlTemplate#TYPE_TOGGLE |
public boolean isChecked ()
Returns | |
---|---|
boolean |