ControlTemplate


public abstract class ControlTemplate
extends Object

java.lang.Object
   ↳ android.service.controls.templates.ControlTemplate
RangeTemplate A template for a Control with inputs in a "continuous" range of values. 
StatelessTemplate A template for a Control which has no state. 
TemperatureControlTemplate A template for a temperature related Control that supports multiple modes. 
ThumbnailTemplate A template for a Control that displays an image. 
ToggleRangeTemplate A template for a Control supporting toggling and a range. 
ToggleTemplate A template for a Control with a single button that can be toggled between two states. 


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_THUMBNAIL

Type identifier of ThumbnailTemplate.

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 template type associated with this class.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Constants

TYPE_ERROR

Added in API level 30
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_THUMBNAIL, TYPE_TOGGLE_RANGE, TYPE_TEMPERATURE, or TYPE_STATELESS

Constant Value: -1 (0xffffffff)

TYPE_NO_TEMPLATE

Added in API level 30
public static final int TYPE_NO_TEMPLATE

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

Constant Value: 0 (0x00000000)

TYPE_RANGE

Added in API level 30
public static final int TYPE_RANGE

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

Constant Value: 2 (0x00000002)

TYPE_STATELESS

Added in API level 30
public static final int TYPE_STATELESS

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

Constant Value: 8 (0x00000008)

TYPE_TEMPERATURE

Added in API level 30
public static final int TYPE_TEMPERATURE

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

Constant Value: 7 (0x00000007)

TYPE_THUMBNAIL

Added in API level 31
public static final int TYPE_THUMBNAIL

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

Constant Value: 3 (0x00000003)

TYPE_TOGGLE

Added in API level 30
public static final int TYPE_TOGGLE

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

Constant Value: 1 (0x00000001)

TYPE_TOGGLE_RANGE

Added in API level 30
public static final int TYPE_TOGGLE_RANGE

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

Constant Value: 6 (0x00000006)

Public methods

getErrorTemplate

Added in API level 30
public static ControlTemplate getErrorTemplate ()

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

getNoTemplateObject

Added in API level 30
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

Added in API level 30
public String getTemplateId ()

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

getTemplateType

Added in API level 30
public abstract int getTemplateType ()

The template type associated with this class.