From e570696b7d0945db0ca13f7b412a95f0de6fa224 Mon Sep 17 00:00:00 2001 From: Lyn Han Date: Tue, 5 May 2020 13:45:13 -0700 Subject: [PATCH] Overflow a11y Fixes: 149232987 Test: manual - TalkBack on for overflow button, overflow bubbles; prompts "double tap to add back to stack" Change-Id: I20f2a3731dca014cf7555d49d676192636bb8d61 --- packages/SystemUI/res/values/strings.xml | 4 +++ .../systemui/bubbles/BubbleOverflow.java | 2 ++ .../bubbles/BubbleOverflowActivity.java | 36 +++++++++++++++++-- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 2b3e661c4f7ea..260e348211371 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -2608,6 +2608,10 @@ Settings for %1$s bubbles + + Overflow + + Add back to stack Manage diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflow.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflow.java index 13669a68defa6..8900402180525 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflow.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflow.java @@ -79,6 +79,8 @@ public class BubbleOverflow implements BubbleViewProvider { mOverflowBtn = (BadgedImageView) mInflater.inflate(R.layout.bubble_overflow_button, parentViewGroup /* root */, false /* attachToRoot */); + mOverflowBtn.setContentDescription(mContext.getResources().getString( + R.string.bubble_overflow_button_content_description)); TypedArray ta = mContext.obtainStyledAttributes( new int[]{android.R.attr.colorBackgroundFloating}); diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java index de54c353fc85c..c2ca9fad6d43c 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleOverflowActivity.java @@ -21,6 +21,7 @@ import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; import android.app.Activity; +import android.app.Notification; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; @@ -32,6 +33,7 @@ import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.accessibility.AccessibilityNodeInfo; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -103,7 +105,7 @@ public class BubbleOverflowActivity extends Activity { - res.getDimensionPixelSize(R.dimen.bubble_overflow_padding); final int viewHeight = recyclerViewHeight / rows; - mAdapter = new BubbleOverflowAdapter(mOverflowBubbles, + mAdapter = new BubbleOverflowAdapter(getApplicationContext(), mOverflowBubbles, mBubbleController::promoteBubbleFromOverflow, viewWidth, viewHeight); mRecyclerView.setAdapter(mAdapter); @@ -221,13 +223,15 @@ public class BubbleOverflowActivity extends Activity { } class BubbleOverflowAdapter extends RecyclerView.Adapter { + private Context mContext; private Consumer mPromoteBubbleFromOverflow; private List mBubbles; private int mWidth; private int mHeight; - public BubbleOverflowAdapter(List list, Consumer promoteBubble, int width, - int height) { + public BubbleOverflowAdapter(Context context, List list, Consumer promoteBubble, + int width, int height) { + mContext = context; mBubbles = list; mPromoteBubbleFromOverflow = promoteBubble; mWidth = width; @@ -260,6 +264,32 @@ class BubbleOverflowAdapter extends RecyclerView.Adapter