StatelessBuilder
class StatelessBuilder
| kotlin.Any | |
| ↳ | android.service.controls.Control.StatelessBuilder |
Builder class for Control. This class facilitates the creation of Control with no state. Must be used to provide controls for ControlsProviderService.createPublisherForAllAvailable and ControlsProviderService.createPublisherForSuggested. It provides the following defaults for non-optional parameters:
- Device type:
DeviceTypes.TYPE_UNKNOWN - Title:
"" - Subtitle:
""
Control as required by ControlsProviderService.createPublisherForAllAvailable:
- Status:
STATUS_UNKNOWN - Control template:
ControlTemplate.getNoTemplateObject - Status text:
"" - Auth Required:
true
Summary
| Public constructors | |
|---|---|
StatelessBuilder(control: Control)Creates a |
|
StatelessBuilder(controlId: String, appIntent: PendingIntent) |
|
| Public methods | |
|---|---|
| Control |
build() |
| Control.StatelessBuilder |
setAppIntent(appIntent: PendingIntent) |
| Control.StatelessBuilder |
setControlId(controlId: String) |
| Control.StatelessBuilder |
setCustomColor(customColor: ColorStateList?)Optional color to be shown with the |
| Control.StatelessBuilder |
setCustomIcon(customIcon: Icon?)Optional icon to be shown with the |
| Control.StatelessBuilder |
setDeviceType(deviceType: Int) |
| Control.StatelessBuilder |
setStructure(structure: CharSequence?)Optional top-level group to help define the |
| Control.StatelessBuilder |
setSubtitle(subtitle: CharSequence) |
| Control.StatelessBuilder |
setTitle(title: CharSequence) |
| Control.StatelessBuilder |
setZone(zone: CharSequence?)Optional group name to help define the |
Public constructors
StatelessBuilder
StatelessBuilder(control: Control)
Creates a StatelessBuilder using an existing Control as a base.
| Parameters | |
|---|---|
control |
Control: base for the builder. This value cannot be null. |
StatelessBuilder
StatelessBuilder(
controlId: String,
appIntent: PendingIntent)
| Parameters | |
|---|---|
controlId |
String: the identifier for the Control This value cannot be null. |
appIntent |
PendingIntent: the pending intent linking to the device Activity. This value cannot be null. |
Public methods
build
fun build(): Control
| Return | |
|---|---|
Control |
a valid Control This value cannot be null. |
setAppIntent
fun setAppIntent(appIntent: PendingIntent): Control.StatelessBuilder
| Parameters | |
|---|---|
appIntent |
PendingIntent: a PendingIntent linking to an Activity for the Control This value cannot be null. |
| Return | |
|---|---|
Control.StatelessBuilder |
this This value cannot be null. |
setControlId
fun setControlId(controlId: String): Control.StatelessBuilder
| Parameters | |
|---|---|
controlId |
String: the identifier for the Control This value cannot be null. |
| Return | |
|---|---|
Control.StatelessBuilder |
this This value cannot be null. |
setCustomColor
fun setCustomColor(customColor: ColorStateList?): Control.StatelessBuilder
Optional color to be shown with the Control. It is highly recommended to let the system default the color unless the default is not suitable for the application.
| Parameters | |
|---|---|
customColor |
ColorStateList?: background color to use. This value may be null. |
| Return | |
|---|---|
Control.StatelessBuilder |
this This value cannot be null. |
setCustomIcon
fun setCustomIcon(customIcon: Icon?): Control.StatelessBuilder
Optional icon to be shown with the Control. It is highly recommended to let the system default the icon unless the default icon is not suitable.
| Parameters | |
|---|---|
customIcon |
Icon?: icon to show. This value may be null. |
| Return | |
|---|---|
Control.StatelessBuilder |
this This value cannot be null. |
setDeviceType
fun setDeviceType(deviceType: Int): Control.StatelessBuilder
| Return | |
|---|---|
Control.StatelessBuilder |
this This value cannot be null. |
setStructure
fun setStructure(structure: CharSequence?): Control.StatelessBuilder
Optional top-level group to help define the Control's location, visible to the user. If not present, the application name will be used as the top-level group. A structure contains zones which contains controls.
| Parameters | |
|---|---|
structure |
CharSequence?: name of the structure containing the control. This value may be null. |
| Return | |
|---|---|
Control.StatelessBuilder |
this This value cannot be null. |
setSubtitle
fun setSubtitle(subtitle: CharSequence): Control.StatelessBuilder
| Parameters | |
|---|---|
subtitle |
CharSequence: additional information about the Control, to appear underneath the title. This value cannot be null. |
| Return | |
|---|---|
Control.StatelessBuilder |
this This value cannot be null. |
setTitle
fun setTitle(title: CharSequence): Control.StatelessBuilder
| Parameters | |
|---|---|
title |
CharSequence: the user facing name of the Control This value cannot be null. |
| Return | |
|---|---|
Control.StatelessBuilder |
this This value cannot be null. |
setZone
fun setZone(zone: CharSequence?): Control.StatelessBuilder
Optional group name to help define the Control's location within a structure, visible to the user. A structure contains zones which contains controls.
| Parameters | |
|---|---|
zone |
CharSequence?: name of the zone containing the control. This value may be null. |
| Return | |
|---|---|
Control.StatelessBuilder |
this This value cannot be null. |