summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/util
diff options
context:
space:
mode:
authorWinson <winsonc@google.com>2016-08-02 12:03:34 -0700
committerWinson <winsonc@google.com>2016-08-02 12:04:05 -0700
commit5bc2827488a53dad60e3b66a27c6deda78f3d83f (patch)
treef01cc5e9bf8c90bf9085a00c7bb9dfe5ca0e1198 /src/com/android/launcher3/util
parentc42087e5c011dbf912c0f8b8d27d15ec5a97dca1 (diff)
downloadandroid_packages_apps_Trebuchet-5bc2827488a53dad60e3b66a27c6deda78f3d83f.tar.gz
android_packages_apps_Trebuchet-5bc2827488a53dad60e3b66a27c6deda78f3d83f.tar.bz2
android_packages_apps_Trebuchet-5bc2827488a53dad60e3b66a27c6deda78f3d83f.zip
Adding workaround to jump in wallpaper offsets.
- Just skip the animation if we are animating to the same wallpaper offset (which is the case when we are adding from all apps) Bug: 28587903 Change-Id: Ib7b1828c1b099a665d68c22cb33ee62693f33f35
Diffstat (limited to 'src/com/android/launcher3/util')
-rw-r--r--src/com/android/launcher3/util/WallpaperOffsetInterpolator.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
index d7b391427..392697458 100644
--- a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
+++ b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
@@ -208,8 +208,9 @@ public class WallpaperOffsetInterpolator implements Choreographer.FrameCallback
scheduleUpdate();
mFinalOffset = Math.max(0f, Math.min(x, 1f));
if (getNumScreensExcludingEmptyAndCustom() != mNumScreens) {
- if (mNumScreens > 0) {
- // Don't animate if we're going from 0 screens
+ if (mNumScreens > 0 && Float.compare(mCurrentOffset, mFinalOffset) != 0) {
+ // Don't animate if we're going from 0 screens, or if the final offset is the same
+ // as the current offset
animateToFinal();
}
mNumScreens = getNumScreensExcludingEmptyAndCustom();