summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-07-08 15:44:27 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-07-09 10:17:46 -0700
commitce5a7e5ee4c880081faef3a508f68725d0317ee9 (patch)
tree3876feee11bb2e56d3b7670dd069aed545f4f8e3 /src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
parent0edfe2c88094ef2e7e36eea71f0cbbbd3bae8df5 (diff)
downloadandroid_packages_apps_Trebuchet-ce5a7e5ee4c880081faef3a508f68725d0317ee9.tar.gz
android_packages_apps_Trebuchet-ce5a7e5ee4c880081faef3a508f68725d0317ee9.tar.bz2
android_packages_apps_Trebuchet-ce5a7e5ee4c880081faef3a508f68725d0317ee9.zip
Fixing screen jump when going to spring_loaded mode in rtl
> Removing call to snapToScreen when changing state > Marking adjacent pages visible in overview and spring_loaded mode, so that they get drawn atleast once. Change-Id: If305e0d4cfa63bac03f301d69017da55f89155bd
Diffstat (limited to 'src/com/android/launcher3/WorkspaceStateTransitionAnimation.java')
-rw-r--r--src/com/android/launcher3/WorkspaceStateTransitionAnimation.java19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
index b8916a72b..5d16cd561 100644
--- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
+++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
@@ -174,7 +174,6 @@ public class WorkspaceStateTransitionAnimation {
public static final String TAG = "WorkspaceStateTransitionAnimation";
- public static final int SCROLL_TO_CURRENT_PAGE = -1;
@Thunk static final int BACKGROUND_FADE_OUT_DURATION = 350;
final @Thunk Launcher mLauncher;
@@ -216,16 +215,18 @@ public class WorkspaceStateTransitionAnimation {
mWorkspaceFadeInAdjacentScreens = grid.shouldFadeAdjacentWorkspaceScreens();
}
+ public void snapToPageFromOverView(int whichPage) {
+ mWorkspace.snapToPage(whichPage, mOverviewTransitionTime, mZoomInInterpolator);
+ }
+
public AnimatorSet getAnimationToState(Workspace.State fromState, Workspace.State toState,
- int toPage, boolean animated, boolean hasOverlaySearchBar,
- HashMap<View, Integer> layerViews) {
+ boolean animated, boolean hasOverlaySearchBar, HashMap<View, Integer> layerViews) {
AccessibilityManager am = (AccessibilityManager)
mLauncher.getSystemService(Context.ACCESSIBILITY_SERVICE);
final boolean accessibilityEnabled = am.isEnabled();
TransitionStates states = new TransitionStates(fromState, toState);
int duration = getAnimationDuration(states);
- animateWorkspace(states, toPage, animated, duration, layerViews,
- accessibilityEnabled);
+ animateWorkspace(states, animated, duration, layerViews, accessibilityEnabled);
animateSearchBar(states, animated, duration, hasOverlaySearchBar, layerViews,
accessibilityEnabled);
animateBackgroundGradient(states, animated, BACKGROUND_FADE_OUT_DURATION);
@@ -265,7 +266,7 @@ public class WorkspaceStateTransitionAnimation {
/**
* Starts a transition animation for the workspace.
*/
- private void animateWorkspace(final TransitionStates states, int toPage, final boolean animated,
+ private void animateWorkspace(final TransitionStates states, final boolean animated,
final int duration, final HashMap<View, Integer> layerViews,
final boolean accessibilityEnabled) {
// Reinitialize animation arrays for the current workspace state
@@ -305,11 +306,7 @@ public class WorkspaceStateTransitionAnimation {
}
}
- if (toPage == SCROLL_TO_CURRENT_PAGE) {
- toPage = mWorkspace.getPageNearestToCenterOfScreen();
- }
- mWorkspace.snapToPage(toPage, duration, mZoomInInterpolator);
-
+ int toPage = mWorkspace.getPageNearestToCenterOfScreen();
for (int i = 0; i < childCount; i++) {
final CellLayout cl = (CellLayout) mWorkspace.getChildAt(i);
boolean isCurrentPage = (i == toPage);