diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-05-04 15:50:25 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-05-06 12:06:48 -0700 |
commit | 1d08f70441999c66b76c97e48b4149e1433be3c3 (patch) | |
tree | a46b0b3ff4cd65b16035366d496ff1030be2c44a /src/com/android/launcher3/WorkspaceStateTransitionAnimation.java | |
parent | deb189fd105a5367d965538fd2ebc4a132346ee4 (diff) | |
download | android_packages_apps_Trebuchet-1d08f70441999c66b76c97e48b4149e1433be3c3.tar.gz android_packages_apps_Trebuchet-1d08f70441999c66b76c97e48b4149e1433be3c3.tar.bz2 android_packages_apps_Trebuchet-1d08f70441999c66b76c97e48b4149e1433be3c3.zip |
Accessibility: Page re-ordering in overview mode
Change-Id: I5fc0ad326a63b6768cb1fae55ee6e05a9fc2b659
Diffstat (limited to 'src/com/android/launcher3/WorkspaceStateTransitionAnimation.java')
-rw-r--r-- | src/com/android/launcher3/WorkspaceStateTransitionAnimation.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index a0cedeb63..61a64e3f3 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -24,8 +24,11 @@ import android.animation.ValueAnimator; import android.content.Context; import android.content.res.Resources; import android.view.View; +import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; +import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.DecelerateInterpolator; + import com.android.launcher3.util.Thunk; import java.util.HashMap; @@ -190,7 +193,7 @@ public class WorkspaceStateTransitionAnimation { final HashMap<View, Integer> layerViews) { AccessibilityManager am = (AccessibilityManager) mLauncher.getSystemService(Context.ACCESSIBILITY_SERVICE); - boolean accessibilityEnabled = am.isEnabled(); + final boolean accessibilityEnabled = am.isEnabled(); // Reinitialize animation arrays for the current workspace state reinitializeAnimationArrays(); @@ -301,7 +304,7 @@ public class WorkspaceStateTransitionAnimation { } final View searchBar = mLauncher.getOrCreateQsbBar(); - final View overviewPanel = mLauncher.getOverviewPanel(); + final ViewGroup overviewPanel = mLauncher.getOverviewPanel(); final View hotseat = mLauncher.getHotseat(); final View pageIndicator = mWorkspace.getPageIndicator(); if (animated) { @@ -424,6 +427,11 @@ public class WorkspaceStateTransitionAnimation { @Override public void onAnimationEnd(Animator animation) { mStateAnimator = null; + + if (accessibilityEnabled && overviewPanel.getVisibility() == View.VISIBLE) { + overviewPanel.getChildAt(0).performAccessibilityAction( + AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null); + } } }); } else { @@ -443,6 +451,11 @@ public class WorkspaceStateTransitionAnimation { mWorkspace.setScaleX(mNewScale); mWorkspace.setScaleY(mNewScale); mWorkspace.setTranslationY(finalWorkspaceTranslationY); + + if (accessibilityEnabled && overviewPanel.getVisibility() == View.VISIBLE) { + overviewPanel.getChildAt(0).performAccessibilityAction( + AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null); + } } if (stateIsNormal) { |