Merge "Adding animation post-installing a shortcut."
This commit is contained in:
@@ -184,6 +184,7 @@ public class Workspace extends SmoothPagedView
|
||||
WallpaperOffsetInterpolator mWallpaperOffset;
|
||||
boolean mUpdateWallpaperOffsetImmediately = false;
|
||||
private Runnable mDelayedResizeRunnable;
|
||||
private Runnable mDelayedSnapToPageRunnable;
|
||||
private int mDisplayWidth;
|
||||
private int mDisplayHeight;
|
||||
private boolean mIsStaticWallpaper;
|
||||
@@ -766,6 +767,11 @@ public class Workspace extends SmoothPagedView
|
||||
mDelayedResizeRunnable.run();
|
||||
mDelayedResizeRunnable = null;
|
||||
}
|
||||
|
||||
if (mDelayedSnapToPageRunnable != null) {
|
||||
mDelayedSnapToPageRunnable.run();
|
||||
mDelayedSnapToPageRunnable = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -907,6 +913,20 @@ public class Workspace extends SmoothPagedView
|
||||
computeWallpaperScrollRatio(whichPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void snapToPage(int whichPage, int duration) {
|
||||
super.snapToPage(whichPage, duration);
|
||||
computeWallpaperScrollRatio(whichPage);
|
||||
}
|
||||
|
||||
protected void snapToPage(int whichPage, Runnable r) {
|
||||
if (mDelayedSnapToPageRunnable != null) {
|
||||
mDelayedSnapToPageRunnable.run();
|
||||
}
|
||||
mDelayedSnapToPageRunnable = r;
|
||||
snapToPage(whichPage, SLOW_PAGE_SNAP_ANIMATION_DURATION);
|
||||
}
|
||||
|
||||
private void computeWallpaperScrollRatio(int page) {
|
||||
// Here, we determine what the desired scroll would be with and without a layout scale,
|
||||
// and compute a ratio between the two. This allows us to adjust the wallpaper offset
|
||||
|
||||
Reference in New Issue
Block a user