diff options
author | 2025-02-04 23:08:14 -0800 | |
---|---|---|
committer | 2025-02-04 23:08:14 -0800 | |
commit | f4f8f15fa15ce7c1fcc07f72eef5f16bd242c6e5 (patch) | |
tree | 3a19aa4a91356416560c8e13a7b75cd50ac24b0d | |
parent | 413c79b34679a7cdf91710ac927338db09c1295f (diff) | |
parent | 517f861e9d97ade62814ca83063b1e2966cbd555 (diff) |
Merge "Add "Restore" a11y text to maximize button when it's a restore state." into main
-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 { |