summaryrefslogtreecommitdiffstats
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
parentfaea1f816ead0033e52b730ab4dd598d2c186168 (diff)
downloadpackages_apps_trebuchet-de1af7661548692d370518528ff91c7422b9c8ae.zip
packages_apps_trebuchet-de1af7661548692d370518528ff91c7422b9c8ae.tar.gz
packages_apps_trebuchet-de1af7661548692d370518528ff91c7422b9c8ae.tar.bz2
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
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java10
-rw-r--r--src/com/android/launcher2/Launcher.java2
-rw-r--r--src/com/android/launcher2/Workspace.java27
3 files changed, 29 insertions, 10 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index ca11c1e..714e7f9 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -40,12 +40,12 @@ import android.os.Process;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
+import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.widget.GridLayout;
import android.widget.ImageView;
-import android.widget.TextView;
import android.widget.Toast;
import com.android.launcher.R;
@@ -244,8 +244,12 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
@Override
- protected void onWallpaperTap(android.view.MotionEvent ev) {
- mLauncher.showWorkspace(true);
+ protected void onWallpaperTap(MotionEvent ev) {
+ int action = ev.getAction();
+ if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_DOWN) {
+ // Dismiss AppsCustomize if we tap
+ mLauncher.showWorkspace(true);
+ }
}
/**
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 996d321..af8d986 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1233,11 +1233,11 @@ public final class Launcher extends Activity
!= Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
// In all these cases, only animate if we're already on home
- mWorkspace.unshrink(alreadyOnHome);
mWorkspace.exitWidgetResizeMode();
if (alreadyOnHome && mState == State.WORKSPACE && !mWorkspace.isTouchActive()) {
mWorkspace.moveToDefaultScreen(true);
}
+ exitSpringLoadedDragMode();
showWorkspace(alreadyOnHome);
final View v = getWindow().peekDecorView();
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 66bb2ab..9913a6b 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();
}