diff options
author | Tony <twickham@google.com> | 2017-07-06 11:32:53 -0700 |
---|---|---|
committer | Tony <twickham@google.com> | 2017-07-06 11:32:53 -0700 |
commit | 6dea7cddf9c79d5acbc1f94219a3f1df1bc86348 (patch) | |
tree | 5951eeabca466b2035355ca646b2617fc3b4b895 /src/com/android/launcher3/Workspace.java | |
parent | 2ed276eb13f38e3383eab872b0bff26d569528c1 (diff) | |
download | android_packages_apps_Trebuchet-6dea7cddf9c79d5acbc1f94219a3f1df1bc86348.tar.gz android_packages_apps_Trebuchet-6dea7cddf9c79d5acbc1f94219a3f1df1bc86348.tar.bz2 android_packages_apps_Trebuchet-6dea7cddf9c79d5acbc1f94219a3f1df1bc86348.zip |
Mark off-screen pages as unimportant for accessibility
ag/2458689 reduced page spacing, making it possible for
adjacent pages to overlap the current viewport. Though
you can't see this overlap due to paddings, this caused
items on the edges of adjacent pages to be focusable in
accessibility.
Bug: 63335071
Change-Id: I1296e7a711e2f0af8fc8bedda70a94a7693c7055
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 28070b7fa..7f1019109 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -1632,16 +1632,21 @@ public class Workspace extends PagedView } private void updatePageAlphaValues() { - if (mWorkspaceFadeInAdjacentScreens && - !workspaceInModalState() && - !mIsSwitchingState) { + if (!workspaceInModalState() && !mIsSwitchingState) { int screenCenter = getScrollX() + getViewportWidth() / 2; for (int i = numCustomPages(); i < getChildCount(); i++) { CellLayout child = (CellLayout) getChildAt(i); if (child != null) { float scrollProgress = getScrollProgress(screenCenter, child, i); float alpha = 1 - Math.abs(scrollProgress); - child.getShortcutsAndWidgets().setAlpha(alpha); + if (mWorkspaceFadeInAdjacentScreens) { + child.getShortcutsAndWidgets().setAlpha(alpha); + } else { + // Pages that are off-screen aren't important for accessibility. + child.getShortcutsAndWidgets().setImportantForAccessibility( + alpha > 0 ? IMPORTANT_FOR_ACCESSIBILITY_AUTO + : IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); + } } } } |