summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2014-07-08 00:03:40 (GMT)
committerRaj Yengisetty <rajesh@cyngn.com>2015-04-27 18:05:50 (GMT)
commitc9e5b1a247e4951fbac7f9af226e2c44448ed6bf (patch)
tree868b8779a9c94c1307929c44ac7a3a052ef019c9
parentb53f60bced4657d35880952732b2bcb811e1b7a6 (diff)
downloadandroid_packages_apps_Trebuchet-c9e5b1a247e4951fbac7f9af226e2c44448ed6bf.zip
android_packages_apps_Trebuchet-c9e5b1a247e4951fbac7f9af226e2c44448ed6bf.tar.gz
android_packages_apps_Trebuchet-c9e5b1a247e4951fbac7f9af226e2c44448ed6bf.tar.bz2
Trebuchet: always set initial wallpaper offsets
After a fresh boot, computeScrollOffset() always returns false. So the result was the offsets were never properly being set on a fresh boot and they were only being applied on first drag of the home screen, which finally triggered computeScrollOffset() to return true. Change-Id: Iccaedd742bed861fca1f50dd54e2e4537fd4c9b0
-rw-r--r--src/com/android/launcher3/Workspace.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index ee812aa..a0b99e5 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1359,6 +1359,7 @@ public class Workspace extends SmoothPagedView
// Don't use all the wallpaper for parallax until you have at least this many pages
private final int MIN_PARALLAX_PAGE_SPAN = 3;
int mNumScreens;
+ boolean mCompletedInitialOffset;
public WallpaperOffsetInterpolator() {
mChoreographer = Choreographer.getInstance();
@@ -1373,7 +1374,8 @@ public class Workspace extends SmoothPagedView
private void updateOffset(boolean force) {
if (mWaitingForUpdate || force) {
mWaitingForUpdate = false;
- if (computeScrollOffset() && mWindowToken != null) {
+ if ((!mCompletedInitialOffset || computeScrollOffset()) && mWindowToken != null) {
+ mCompletedInitialOffset = true;
try {
mWallpaperManager.setWallpaperOffsets(mWindowToken,
mWallpaperOffset.getCurrX(), 0.5f);