From a659bfe3d2fd28a06fb04c3ca08238ec3f94f6e2 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 2 Aug 2016 16:15:37 -0700 Subject: [PATCH] Updating content description for the shortcuts menu and announcing it when the container is opened Bug: 30587453 Change-Id: I6f2d3ba05593f3e2a1a8f05c66a0f80e76932c38 --- res/values/strings.xml | 3 +++ .../android/launcher3/shortcuts/DeepShortcutsContainer.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/res/values/strings.xml b/res/values/strings.xml index 2bc0cae0e7..d11d5a56d6 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -254,4 +254,7 @@ Shortcuts + + %1$d shortcuts for %2$s + diff --git a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java index 53a28de427..3d1bee59d0 100644 --- a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java +++ b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java @@ -40,6 +40,7 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; +import android.view.accessibility.AccessibilityEvent; import android.view.animation.DecelerateInterpolator; import android.widget.LinearLayout; @@ -147,6 +148,8 @@ public class DeepShortcutsContainer extends LinearLayout implements View.OnLongC shortcut.getBubbleText().setAccessibilityDelegate(mAccessibilityDelegate); addView(shortcut); } + setContentDescription(getContext().getString(R.string.shortcuts_menu_description, + numShortcuts, originalIcon.getContentDescription().toString())); measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED); orientAboutIcon(originalIcon); @@ -276,6 +279,8 @@ public class DeepShortcutsContainer extends LinearLayout implements View.OnLongC @Override public void onAnimationEnd(Animator animation) { mOpenCloseAnimator = null; + + sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); } });