Adding animation post-installing a shortcut.
Change-Id: I63bb3b713fab28a43e61333dd331dbf2d211faa7
This commit is contained in:
1 parent
6b8a02d63a
commit
f0c6ae0e35
8 files changed
+215
-57
No files matched your search
@@ -183,6 +183,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;
|
||||
@@ -765,6 +766,11 @@ public class Workspace extends SmoothPagedView
|
||||
mDelayedResizeRunnable.run();
|
||||
mDelayedResizeRunnable = null;
|
||||
}
|
||||
|
||||
if (mDelayedSnapToPageRunnable != null) {
|
||||
mDelayedSnapToPageRunnable.run();
|
||||
mDelayedSnapToPageRunnable = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -906,6 +912,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