diff options
| author | 2025-02-04 00:43:46 -0800 | |
|---|---|---|
| committer | 2025-02-04 17:50:44 -0800 | |
| commit | 517f861e9d97ade62814ca83063b1e2966cbd555 (patch) | |
| tree | 3dd2bc9431de2b0b274032bc04950375e6dceb8c | |
| parent | f651f6875c7a2de4e02fe9f197f7bc1c5b8f8612 (diff) | |
Add "Restore" a11y text to maximize button when it's a restore state.
When the maximize button becomes a restore button/action, we should
change it so a11y services announce that.
Bug: 329351829
Test: Manual. Enable talkback, focus on the button when it's in Restore
- hears "Restore"
Flag: EXEMPT bugfix
Change-Id: I253f96d789abb3c891a23aa64f90025faeefafdd
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/MaximizeButtonView.kt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/MaximizeButtonView.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/MaximizeButtonView.kt index e23ebe6634ff..581d1867ddf0 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/MaximizeButtonView.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/MaximizeButtonView.kt @@ -53,6 +53,10 @@ class MaximizeButtonView( (stubProgressBarContainer.inflate() as FrameLayout) .requireViewById(R.id.progress_bar) } + private val maximizeButtonText = + context.resources.getString(R.string.desktop_mode_maximize_menu_maximize_button_text) + private val restoreButtonText = + context.resources.getString(R.string.desktop_mode_maximize_menu_restore_button_text) init { LayoutInflater.from(context).inflate(R.layout.maximize_menu_button, this, true) @@ -154,6 +158,12 @@ class MaximizeButtonView( /** Set the drawable resource to use for the maximize button. */ fun setIcon(@DrawableRes icon: Int) { maximizeWindow.setImageResource(icon) + when (icon) { + R.drawable.decor_desktop_mode_immersive_or_maximize_exit_button_dark -> + maximizeWindow.contentDescription = restoreButtonText + R.drawable.decor_desktop_mode_maximize_button_dark -> + maximizeWindow.contentDescription = maximizeButtonText + } } companion object { |