Merge "Controls UI - Tap for NO_TEMPLATE" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d6fb5e2151
@@ -214,10 +214,13 @@ public abstract class ControlTemplate {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a singleton {@link ControlTemplate} that has no features.
|
||||
* Get a singleton {@link ControlTemplate}, which supports no direct user input.
|
||||
*
|
||||
* This template has no distinctive field, not even an identifier. Used for a {@link Control}
|
||||
* that accepts no type of input, or when there is no known state.
|
||||
* Used by {@link Control.StatelessBuilder} when there is no known state. Can also be used
|
||||
* in {@link Control.StatefulBuilder} for conveying information to a user about the
|
||||
* {@link Control} but direct user interaction is not desired. Since this template has no
|
||||
* corresponding {@link ControlAction}, any user interaction will launch the
|
||||
* {@link Control#getAppIntent()}.
|
||||
*
|
||||
* @return a singleton {@link ControlTemplate} to indicate no specific template is used by
|
||||
* this {@link Control}
|
||||
|
||||
@@ -89,6 +89,7 @@ class ControlViewHolder(
|
||||
return when {
|
||||
status != Control.STATUS_OK -> StatusBehavior::class
|
||||
deviceType == DeviceTypes.TYPE_CAMERA -> TouchBehavior::class
|
||||
template == ControlTemplate.NO_TEMPLATE -> TouchBehavior::class
|
||||
template is ToggleTemplate -> ToggleBehavior::class
|
||||
template is StatelessTemplate -> TouchBehavior::class
|
||||
template is ToggleRangeTemplate -> ToggleRangeBehavior::class
|
||||
@@ -235,7 +236,10 @@ class ControlViewHolder(
|
||||
controlsController.action(cws.componentName, cws.ci, action)
|
||||
}
|
||||
|
||||
fun usePanel(): Boolean = deviceType in ControlViewHolder.FORCE_PANEL_DEVICES
|
||||
fun usePanel(): Boolean {
|
||||
return deviceType in ControlViewHolder.FORCE_PANEL_DEVICES ||
|
||||
controlTemplate == ControlTemplate.NO_TEMPLATE
|
||||
}
|
||||
|
||||
fun bindBehavior(
|
||||
existingBehavior: Behavior?,
|
||||
|
||||
Reference in New Issue
Block a user