summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-10-30 10:10:05 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-10-30 10:10:05 -0700
commita899936005c1f8df7a9a4573a99bd3c14b63dd7e (patch)
tree19f8b0d7626f5d979b21a03817274a850f3de46a
parentbbd4b29f1e4be6f47fe31ee69e3a2b34e3daa5d6 (diff)
parentbc85f483014bc24471b68867ecfed2a4aa5c0b15 (diff)
downloadandroid_packages_apps_Trebuchet-a899936005c1f8df7a9a4573a99bd3c14b63dd7e.tar.gz
android_packages_apps_Trebuchet-a899936005c1f8df7a9a4573a99bd3c14b63dd7e.tar.bz2
android_packages_apps_Trebuchet-a899936005c1f8df7a9a4573a99bd3c14b63dd7e.zip
am bc85f483: am 2f1ac9eb: am 36095e86: Merge "Stop animating All Apps during transition to Home" into jb-mr1-dev
* commit 'bc85f483014bc24471b68867ecfed2a4aa5c0b15': Stop animating All Apps during transition to Home
-rw-r--r--src/com/android/launcher2/Launcher.java3
-rw-r--r--src/com/android/launcher2/PagedView.java23
2 files changed, 24 insertions, 2 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 0225d28bf..c221815a4 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2697,6 +2697,7 @@ public final class Launcher extends Activity
dispatchOnLauncherTransitionPrepare(fromView, animated, true);
dispatchOnLauncherTransitionPrepare(toView, animated, true);
+ mAppsCustomizeContent.pauseScrolling();
mStateAnimation.addListener(new AnimatorListenerAdapter() {
@Override
@@ -2711,6 +2712,8 @@ public final class Launcher extends Activity
if (onCompleteRunnable != null) {
onCompleteRunnable.run();
}
+ mAppsCustomizeContent.updateCurrentPageScroll();
+ mAppsCustomizeContent.resumeScrolling();
}
});
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 2fc788b83..2cb943d7d 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -182,6 +182,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected static final int sScrollIndicatorFadeInDuration = 150;
protected static final int sScrollIndicatorFadeOutDuration = 650;
protected static final int sScrollIndicatorFlashDuration = 650;
+ private boolean mScrollingPaused = false;
// If set, will defer loading associated pages until the scrolling settles
private boolean mDeferLoadAssociatedPagesUntilScrollCompletes;
@@ -305,6 +306,24 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
/**
+ * Called during AllApps/Home transitions to avoid unnecessary work. When that other animation
+ * ends, {@link #resumeScrolling()} should be called, along with
+ * {@link #updateCurrentPageScroll()} to correctly set the final state and re-enable scrolling.
+ */
+ void pauseScrolling() {
+ mScroller.forceFinished(true);
+ cancelScrollingIndicatorAnimations();
+ mScrollingPaused = true;
+ }
+
+ /**
+ * Enables scrolling again.
+ * @see #pauseScrolling()
+ */
+ void resumeScrolling() {
+ mScrollingPaused = false;
+ }
+ /**
* Sets the current page.
*/
void setCurrentPage(int currentPage) {
@@ -1745,7 +1764,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
updateScrollingIndicatorPosition();
mScrollIndicator.setVisibility(View.VISIBLE);
cancelScrollingIndicatorAnimations();
- if (immediately) {
+ if (immediately || mScrollingPaused) {
mScrollIndicator.setAlpha(1f);
} else {
mScrollIndicatorAnimator = LauncherAnimUtils.ofFloat(mScrollIndicator, "alpha", 1f);
@@ -1770,7 +1789,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// Fade the indicator out
updateScrollingIndicatorPosition();
cancelScrollingIndicatorAnimations();
- if (immediately) {
+ if (immediately || mScrollingPaused) {
mScrollIndicator.setVisibility(View.INVISIBLE);
mScrollIndicator.setAlpha(0f);
} else {