# Print output for @column tags ?> ControlTemplate - Android SDK | Android Developers

Most visited

Recently visited

ControlTemplate

public abstract class ControlTemplate
extends Object

java.lang.Object
   ↳ android.service.controls.templates.ControlTemplate


An abstract input template for a Control. Specifies what layout is presented to the user for a given Control.

Some instances of Control can originate actions (via user interaction) to modify its associated state. The actions available to a given Control are determined by its ControlTemplate.

See also:

Summary

Constants

int TYPE_ERROR

Type identifier of the template returned by getErrorTemplate().

int TYPE_NO_TEMPLATE

Type identifier of ControlTemplate#getNoTemplateObject.

int TYPE_RANGE

Type identifier of RangeTemplate.

int TYPE_STATELESS

Type identifier of StatelessTemplate.

int TYPE_TEMPERATURE

Type identifier of TemperatureControlTemplate.

int TYPE_TOGGLE

Type identifier of ToggleTemplate.

int TYPE_TOGGLE_RANGE

Type identifier of ToggleRangeTemplate.

Public methods

static ControlTemplate getErrorTemplate()
static ControlTemplate getNoTemplateObject()

Get a singleton ControlTemplate, which supports no direct user input.

String getTemplateId()
abstract int getTemplateType()

The TemplateType associated with this class.

Inherited methods

Constants

TYPE_ERROR

public static final int TYPE_ERROR

Type identifier of the template returned by getErrorTemplate().
Value is TYPE_ERROR, TYPE_NO_TEMPLATE, TYPE_TOGGLE, TYPE_RANGE, TYPE_TOGGLE_RANGE, TYPE_TEMPERATURE, or TYPE_STATELESS

Constant Value: -1 (0xffffffff)

TYPE_NO_TEMPLATE

public static final int TYPE_NO_TEMPLATE

Type identifier of ControlTemplate#getNoTemplateObject.
Value is TYPE_ERROR, TYPE_NO_TEMPLATE, TYPE_TOGGLE, TYPE_RANGE, TYPE_TOGGLE_RANGE, TYPE_TEMPERATURE, or TYPE_STATELESS

Constant Value: 0 (0x00000000)

TYPE_RANGE

public static final int TYPE_RANGE

Type identifier of RangeTemplate.
Value is TYPE_ERROR, TYPE_NO_TEMPLATE, TYPE_TOGGLE, TYPE_RANGE, TYPE_TOGGLE_RANGE, TYPE_TEMPERATURE, or TYPE_STATELESS

Constant Value: 2 (0x00000002)

TYPE_STATELESS

public static final int TYPE_STATELESS

Type identifier of StatelessTemplate.
Value is TYPE_ERROR, TYPE_NO_TEMPLATE, TYPE_TOGGLE, TYPE_RANGE, TYPE_TOGGLE_RANGE, TYPE_TEMPERATURE, or TYPE_STATELESS

Constant Value: 8 (0x00000008)

TYPE_TEMPERATURE

public static final int TYPE_TEMPERATURE

Type identifier of TemperatureControlTemplate.
Value is TYPE_ERROR, TYPE_NO_TEMPLATE, TYPE_TOGGLE, TYPE_RANGE, TYPE_TOGGLE_RANGE, TYPE_TEMPERATURE, or TYPE_STATELESS

Constant Value: 7 (0x00000007)

TYPE_TOGGLE

public static final int TYPE_TOGGLE

Type identifier of ToggleTemplate.
Value is TYPE_ERROR, TYPE_NO_TEMPLATE, TYPE_TOGGLE, TYPE_RANGE, TYPE_TOGGLE_RANGE, TYPE_TEMPERATURE, or TYPE_STATELESS

Constant Value: 1 (0x00000001)

TYPE_TOGGLE_RANGE

public static final int TYPE_TOGGLE_RANGE

Type identifier of ToggleRangeTemplate.
Value is TYPE_ERROR, TYPE_NO_TEMPLATE, TYPE_TOGGLE, TYPE_RANGE, TYPE_TOGGLE_RANGE, TYPE_TEMPERATURE, or TYPE_STATELESS

Constant Value: 6 (0x00000006)

Public methods

getErrorTemplate

public static ControlTemplate getErrorTemplate ()

Returns
ControlTemplate a singleton ControlTemplate used for indicating an error in unparceling. This value cannot be null.

getNoTemplateObject

public static 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().

Returns
ControlTemplate a singleton ControlTemplate to indicate no specific template is used by this Control This value cannot be null.

getTemplateId

public String getTemplateId ()

Returns
String the identifier for this object. This value cannot be null.

getTemplateType

public abstract int getTemplateType ()

The TemplateType associated with this class.

Returns
int Value is TYPE_ERROR, TYPE_NO_TEMPLATE, TYPE_TOGGLE, TYPE_RANGE, TYPE_TOGGLE_RANGE, TYPE_TEMPERATURE, or TYPE_STATELESS