Merge "Adding workaround to jump in wallpaper offsets." into ub-launcher3-calgary

This commit is contained in:
Winson Chung authored and Android (Google) Code Review committed 2016-08-02 20:01:32 +00:00
commit f7296c373a
1 file changed
+3 -2
@@ -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();