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

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.