diff options
author | Vadim Tryshev <vadimt@google.com> | 2015-05-15 08:48:11 -0700 |
---|---|---|
committer | Vadim Tryshev <vadimt@google.com> | 2015-05-28 14:33:36 -0700 |
commit | 7af0d4474fe811b66db67f358ee0b5ef84b97a18 (patch) | |
tree | 46229bab6b657ea37b720792e11660b2c033cdc5 /src/com/android/launcher3 | |
parent | bbcf5ac7aa73a3ce07215d77a0b496cf7fb00f29 (diff) | |
download | android_packages_apps_Trebuchet-7af0d4474fe811b66db67f358ee0b5ef84b97a18.tar.gz android_packages_apps_Trebuchet-7af0d4474fe811b66db67f358ee0b5ef84b97a18.tar.bz2 android_packages_apps_Trebuchet-7af0d4474fe811b66db67f358ee0b5ef84b97a18.zip |
Fixing non-scrolling of workspace view after opening/closing AllApps vew.
The reason for non-scrolling was excluding the pages view from the
accessibility hierarchy by marking it as non-important. So, I just
removed the code manipulating [non]importance of the PagedView.
However, this would make the PagesView accessibility-focusable, which is
undesirable. It becomes focusable because it supports long clicks in "normal"
mode. Since it doesn't support accessibility long clicks (i.e. Overview mode is
fetched NOT via accessibility long-click), I just disabled accessibility
long-clickability, which made PageView non-focusable, and it started to behave
correctly.
Bug: 21281859
Change-Id: I7ab01e5f39cb37c456c961199c27458c9bda1c3d
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r-- | src/com/android/launcher3/PagedView.java | 11 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 10 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index dda9a166c..502caaf32 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -853,7 +853,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc int offsetY = getViewportOffsetY(); // Update the viewport offsets - mViewport.offset(offsetX, offsetY); + mViewport.offset(offsetX, offsetY); final int startIndex = mIsRtl ? childCount - 1 : 0; final int endIndex = mIsRtl ? -1 : childCount; @@ -2347,6 +2347,15 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc if (getCurrentPage() > 0) { info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD); } + info.setClassName(getClass().getName()); + + // Accessibility-wise, PagedView doesn't support long click, so disabling it. + // Besides disabling the accessibility long-click, this also prevents this view from getting + // accessibility focus. + info.setLongClickable(false); + if (Utilities.isLmpOrAbove()) { + info.removeAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_LONG_CLICK); + } } @Override diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index d2c37d209..8b783abc2 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -327,7 +327,6 @@ public class Workspace extends SmoothPagedView // Disable multitouch across the workspace/all apps/customize tray setMotionEventSplittingEnabled(true); - setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); } @Override @@ -2019,14 +2018,9 @@ public class Workspace extends SmoothPagedView for (int i = numCustomPages(); i < total; i++) { updateAccessibilityFlags((CellLayout) getPageAt(i), i); } - if (mState == State.NORMAL) { - setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); - } else { - setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES); - } } else { int accessible = mState == State.NORMAL ? - IMPORTANT_FOR_ACCESSIBILITY_NO : + IMPORTANT_FOR_ACCESSIBILITY_AUTO : IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS; setImportantForAccessibility(accessible); } @@ -2045,7 +2039,7 @@ public class Workspace extends SmoothPagedView page.setAccessibilityDelegate(mPagesAccessibilityDelegate); } else { int accessible = mState == State.NORMAL ? - IMPORTANT_FOR_ACCESSIBILITY_NO : + IMPORTANT_FOR_ACCESSIBILITY_AUTO : IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS; page.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); page.getShortcutsAndWidgets().setImportantForAccessibility(accessible); |