summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Workspace.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-07-21 16:44:07 -0700
committerWinson Chung <winsonc@google.com>2011-07-21 17:03:47 -0700
commitde1af7661548692d370518528ff91c7422b9c8ae (patch)
tree660559fd0be85407b4a810e0dd8cdb0b66619988 /src/com/android/launcher2/Workspace.java
parentfaea1f816ead0033e52b730ab4dd598d2c186168 (diff)
downloadandroid_packages_apps_Trebuchet-de1af7661548692d370518528ff91c7422b9c8ae.tar.gz
android_packages_apps_Trebuchet-de1af7661548692d370518528ff91c7422b9c8ae.tar.bz2
android_packages_apps_Trebuchet-de1af7661548692d370518528ff91c7422b9c8ae.zip
Fixing transition issues from AppsCustomize.
- Preventing weird space when hitting home while configuring - Workaround for issue with all workspace items disappearing when going out of AllApps (depends on 5052094 for proper fix) - Fixing isuse where any multi-finger tap on AppsCustomize would dismiss it Change-Id: Ibfa8607a66e81703bd78736b72fd7f021e5971d9
Diffstat (limited to 'src/com/android/launcher2/Workspace.java')
-rw-r--r--src/com/android/launcher2/Workspace.java27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 66bb2ab0d..9913a6b3d 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -164,6 +164,10 @@ public class Workspace extends SmoothPagedView
private AnimatorSet mAnimator;
private AnimatorListener mShrinkAnimationListener;
private AnimatorListener mUnshrinkAnimationListener;
+ // Working around the face that cancelled animations may not actually be cancelled if they
+ // are cancelled before starting
+ private boolean mShrinkAnimationEnabled;
+ private boolean mUnshrinkAnimationEnabled;
boolean mAnimatingViewIntoPlace = false;
boolean mIsDragOccuring = false;
@@ -1394,6 +1398,9 @@ public class Workspace extends SmoothPagedView
}
mAnimator = new AnimatorSet();
+ // Workaround the AnimatorSet cancel bug...
+ mUnshrinkAnimationEnabled = false;
+ mShrinkAnimationEnabled = true;
final int childCount = getChildCount();
initAnimationArrays();
@@ -1484,6 +1491,7 @@ public class Workspace extends SmoothPagedView
final float newVerticalWallpaperOffset = wallpaperOffset;
animWithInterpolator.addUpdateListener(new LauncherAnimatorUpdateListener() {
public void onAnimationUpdate(float a, float b) {
+ if (!mShrinkAnimationEnabled) return;
mTransitionProgress = b;
if (b == 0f) {
// an optimization, and required for correct behavior.
@@ -1695,6 +1703,11 @@ public class Workspace extends SmoothPagedView
}
mAnimator = new AnimatorSet();
+
+ // Workaround the AnimatorSet cancel bug...
+ mShrinkAnimationEnabled = false;
+ mUnshrinkAnimationEnabled = true;
+
final int screenCount = getChildCount();
initAnimationArrays();
@@ -1797,6 +1810,7 @@ public class Workspace extends SmoothPagedView
final float newVerticalWallpaperOffset = enableWallpaperEffects ? 0.5f : 0;
animWithInterpolator.addUpdateListener(new LauncherAnimatorUpdateListener() {
public void onAnimationUpdate(float a, float b) {
+ if (!mUnshrinkAnimationEnabled) return;
mTransitionProgress = b;
if (b == 0f) {
// an optimization, but not required
@@ -1832,6 +1846,7 @@ public class Workspace extends SmoothPagedView
rotationAnim.setInterpolator(new DecelerateInterpolator(2.0f));
rotationAnim.addUpdateListener(new LauncherAnimatorUpdateListener() {
public void onAnimationUpdate(float a, float b) {
+ if (!mUnshrinkAnimationEnabled) return;
// don't invalidate workspace because we did it above
if (b == 0f) {
// an optimization, but not required
@@ -3469,12 +3484,12 @@ public class Workspace extends SmoothPagedView
}
void moveToDefaultScreen(boolean animate) {
- if (isSmall() || mIsSwitchingState) {
- mLauncher.showWorkspace(animate, (CellLayout) getChildAt(mDefaultPage));
- } else if (animate) {
- snapToPage(mDefaultPage);
- } else {
- setCurrentPage(mDefaultPage);
+ if (!isSmall()) {
+ if (animate) {
+ snapToPage(mDefaultPage);
+ } else {
+ setCurrentPage(mDefaultPage);
+ }
}
getChildAt(mDefaultPage).requestFocus();
}