diff options
| author | 2020-05-15 20:08:06 +0000 | |
|---|---|---|
| committer | 2020-05-15 20:08:06 +0000 | |
| commit | da83ef8885d9bbdc48d494b7d481c6c720cffc96 (patch) | |
| tree | 09790e361d3631fa9c9eb3186830cf1113d84f47 | |
| parent | 00d9898cd9e2eecd36f2276344c7ed01d4121b9f (diff) | |
| parent | c8796858a2cbbaa2e649febd04d531beb87d8f5d (diff) | |
Merge "Controls a11y - Various fixes" into rvc-dev
5 files changed, 10 insertions, 4 deletions
diff --git a/packages/SystemUI/res/layout/controls_dialog_pin.xml b/packages/SystemUI/res/layout/controls_dialog_pin.xml index 832c48e509f5..170b32b6c669 100644 --- a/packages/SystemUI/res/layout/controls_dialog_pin.xml +++ b/packages/SystemUI/res/layout/controls_dialog_pin.xml @@ -26,6 +26,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="48dp" + android:longClickable="false" android:inputType="numberPassword" /> <CheckBox android:id="@+id/controls_pin_use_alpha" diff --git a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt index 3a4e82c3793f..ff40a8a883ae 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsEditingActivity.kt @@ -130,6 +130,7 @@ class ControlsEditingActivity @Inject constructor( inflate() } requireViewById<TextView>(R.id.title).text = structure + setTitle(structure) subtitle = requireViewById<TextView>(R.id.subtitle).apply { setText(SUBTITLE_ID) } diff --git a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt index eb15262acf74..496b21b612fe 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsFavoritingActivity.kt @@ -208,7 +208,7 @@ class ControlsFavoritingActivity @Inject constructor( val name = listOfStructures[position].structureName val title = if (!TextUtils.isEmpty(name)) name else appName titleView.text = title - setTitle(title) + titleView.requestFocus() } override fun onPageScrolled( diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ChallengeDialogs.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ChallengeDialogs.kt index b6c09f124f77..6c28d11df655 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ChallengeDialogs.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ChallengeDialogs.kt @@ -124,7 +124,7 @@ object ChallengeDialogs { } val builder = AlertDialog.Builder(cvh.context, STYLE).apply { val res = cvh.context.resources - setMessage(res.getString( + setTitle(res.getString( R.string.controls_confirmation_message, cvh.title.getText())) setPositiveButton( android.R.string.ok, diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt index 1bcf10c36767..17e423416064 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt @@ -145,8 +145,7 @@ class ControlViewHolder( } behavior = bindBehavior(behavior, findBehaviorClass(controlStatus, template, deviceType)) - - layout.setContentDescription("${title.text} ${subtitle.text} ${status.text}") + updateContentDescription() } fun actionResponse(@ControlAction.ResponseResult response: Int) { @@ -191,11 +190,16 @@ class ControlViewHolder( cancelUpdate = uiExecutor.executeDelayed({ status.setText(previousText) + updateContentDescription() }, UPDATE_DELAY_IN_MILLIS) status.setText(tempStatus) + updateContentDescription() } + private fun updateContentDescription() = + layout.setContentDescription("${title.text} ${subtitle.text} ${status.text}") + fun action(action: ControlAction) { lastAction = action controlsController.action(cws.componentName, cws.ci, action) |