diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2018-05-15 13:55:57 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2018-05-16 13:11:00 -0700 |
commit | de7532154259ed79d7ed6d2fcc9e82ff2860a5a3 (patch) | |
tree | a8865d45fd1ce0b2dc6d01beee460e34b35d27a3 /src/com/android/launcher3/popup/PopupContainerWithArrow.java | |
parent | 6ae02c6a61e2d2c7014bd5f8b2a0266c5b802245 (diff) | |
download | android_packages_apps_Trebuchet-de7532154259ed79d7ed6d2fcc9e82ff2860a5a3.tar.gz android_packages_apps_Trebuchet-de7532154259ed79d7ed6d2fcc9e82ff2860a5a3.tar.bz2 android_packages_apps_Trebuchet-de7532154259ed79d7ed6d2fcc9e82ff2860a5a3.zip |
Fixing wrong accessibility focus when opening a floating view
> Using common logic for announcing a floating view for widgets and folders
Bug: 79091095
Bug: 79748886
Change-Id: Ibb3fe48e68e724f50d69f51a03d3b35ad0baf625
Diffstat (limited to 'src/com/android/launcher3/popup/PopupContainerWithArrow.java')
-rw-r--r-- | src/com/android/launcher3/popup/PopupContainerWithArrow.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index 763eb6fb6..f276fbfea 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -34,6 +34,7 @@ import android.os.Build; import android.os.Handler; import android.os.Looper; import android.util.AttributeSet; +import android.util.Pair; import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; @@ -263,9 +264,7 @@ public class PopupContainerWithArrow extends ArrowPopup implements DragSource, ItemInfo originalItemInfo = (ItemInfo) originalIcon.getTag(); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { - setAccessibilityPaneTitle(getContext().getString(mNumNotifications == 0 ? - R.string.action_deep_shortcut : - R.string.shortcuts_menu_with_notifications_description)); + setAccessibilityPaneTitle(getTitleForAccessibility()); } mLauncher.getDragController().addDragListener(this); @@ -281,6 +280,17 @@ public class PopupContainerWithArrow extends ArrowPopup implements DragSource, this, shortcutIds, mShortcuts, notificationKeys)); } + private String getTitleForAccessibility() { + return getContext().getString(mNumNotifications == 0 ? + R.string.action_deep_shortcut : + R.string.shortcuts_menu_with_notifications_description); + } + + @Override + protected Pair<View, String> getAccessibilityTarget() { + return Pair.create(this, ""); + } + @Override protected void getTargetObjectLocation(Rect outPos) { mLauncher.getDragLayer().getDescendantRectRelativeToSelf(mOriginalIcon, outPos); |