diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-08-02 16:15:37 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-08-02 16:16:16 -0700 |
commit | a659bfe3d2fd28a06fb04c3ca08238ec3f94f6e2 (patch) | |
tree | 5fbf72dc54797a34437c3f007ad3e78f3b915252 | |
parent | 4b76455543a016a33689b4eb67fe23338fbac4da (diff) | |
download | android_packages_apps_Trebuchet-a659bfe3d2fd28a06fb04c3ca08238ec3f94f6e2.tar.gz android_packages_apps_Trebuchet-a659bfe3d2fd28a06fb04c3ca08238ec3f94f6e2.tar.bz2 android_packages_apps_Trebuchet-a659bfe3d2fd28a06fb04c3ca08238ec3f94f6e2.zip |
Updating content description for the shortcuts menu and announcing
it when the container is opened
Bug: 30587453
Change-Id: I6f2d3ba05593f3e2a1a8f05c66a0f80e76932c38
-rw-r--r-- | res/values/strings.xml | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 2bc0cae0e..d11d5a56d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -254,4 +254,7 @@ <!-- Accessibility action to show quick actions menu for an icon. [CHAR_LIMIT=30] --> <string name="action_deep_shortcut">Shortcuts</string> + <!-- Accessibility description for the shortcuts menu shown for an app. --> + <string name="shortcuts_menu_description"><xliff:g id="number_of_shortcuts" example="3">%1$d</xliff:g> shortcuts for <xliff:g id="app_name" example="Messenger">%2$s</xliff:g></string> + </resources> diff --git a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java index 53a28de42..3d1bee59d 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); } }); |