Added in API level 30

ControlTemplate


abstract class ControlTemplate
kotlin.Any
   ↳ 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.

Summary

Constants
static Int

Type identifier of the template returned by getErrorTemplate().

static Int

Type identifier of ControlTemplate.getNoTemplateObject.

static Int

Type identifier of RangeTemplate.

static Int

Type identifier of StatelessTemplate.

static Int

Type identifier of TemperatureControlTemplate.

static Int

Type identifier of ThumbnailTemplate.

static Int

Type identifier of ToggleTemplate.

static Int

Type identifier of ToggleRangeTemplate.

Public methods
open static ControlTemplate

open static ControlTemplate

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

open String

abstract Int

The template type associated with this class.

Constants

TYPE_ERROR

Added in API level 30
static val TYPE_ERROR: Int

Type identifier of the template returned by getErrorTemplate().
Value is one of the following:

Value: -1

TYPE_NO_TEMPLATE

Added in API level 30
static val TYPE_NO_TEMPLATE: Int

Type identifier of ControlTemplate.getNoTemplateObject.
Value is one of the following:

Value: 0

TYPE_RANGE

Added in API level 30
static val TYPE_RANGE: Int

Type identifier of RangeTemplate.
Value is one of the following:

Value: 2

TYPE_STATELESS

Added in API level 30
static val TYPE_STATELESS: Int

Type identifier of StatelessTemplate.
Value is one of the following:

Value: 8

TYPE_TEMPERATURE

Added in API level 30
static val TYPE_TEMPERATURE: Int

Type identifier of TemperatureControlTemplate.
Value is one of the following:

Value: 7

TYPE_THUMBNAIL

Added in API level 31
static val TYPE_THUMBNAIL: Int

Type identifier of ThumbnailTemplate.
Value is one of the following:

Value: 3

TYPE_TOGGLE

Added in API level 30
static val TYPE_TOGGLE: Int

Type identifier of ToggleTemplate.
Value is one of the following:

Value: 1

TYPE_TOGGLE_RANGE

Added in API level 30
static val TYPE_TOGGLE_RANGE: Int

Type identifier of ToggleRangeTemplate.
Value is one of the following:

Value: 6

Public methods

getErrorTemplate

Added in API level 30
open static fun getErrorTemplate(): ControlTemplate
Return
ControlTemplate a singleton ControlTemplate used for indicating an error in unparceling.
This value cannot be null.

getNoTemplateObject

Added in API level 30
open static fun getNoTemplateObject(): ControlTemplate

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

Return
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
open fun getTemplateId(): String
Return
String the identifier for this object.
This value cannot be null.

getTemplateType

Added in API level 30
abstract fun getTemplateType(): Int

The template type associated with this class.

Return
Int Value is one of the following: