diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-09-02 10:41:43 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-09-02 10:52:07 -0700 |
commit | 52851aa3fd2dd9957e190d779f904f6abaf53fed (patch) | |
tree | a45ec27214e4f1e6e074d15451c0fb469884305b /src/com/android/launcher3/Utilities.java | |
parent | 94b510cc683a6436ae82c6d323cbd8b429561b06 (diff) | |
download | android_packages_apps_Trebuchet-52851aa3fd2dd9957e190d779f904f6abaf53fed.tar.gz android_packages_apps_Trebuchet-52851aa3fd2dd9957e190d779f904f6abaf53fed.tar.bz2 android_packages_apps_Trebuchet-52851aa3fd2dd9957e190d779f904f6abaf53fed.zip |
Fixing topView not being considered in all places when calculating accessible
and focusable views
Bug: 30563273
Change-Id: I6253ce33ee5c328efdde2ea733029975b31e5eb8
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r-- | src/com/android/launcher3/Utilities.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index f2cf12099..e34f509da 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -58,6 +58,8 @@ import android.util.SparseArray; import android.util.TypedValue; import android.view.MotionEvent; import android.view.View; +import android.view.accessibility.AccessibilityEvent; +import android.view.accessibility.AccessibilityManager; import android.widget.Toast; import com.android.launcher3.compat.UserHandleCompat; @@ -906,4 +908,15 @@ public final class Utilities { ta.recycle(); return colorAccent; } + + public static void sendCustomAccessibilityEvent(View target, int type, String text) { + AccessibilityManager accessibilityManager = (AccessibilityManager) + target.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); + if (accessibilityManager.isEnabled()) { + AccessibilityEvent event = AccessibilityEvent.obtain(type); + target.onInitializeAccessibilityEvent(event); + event.getText().add(text); + accessibilityManager.sendAccessibilityEvent(event); + } + } } |