summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2014-07-08 00:03:40 (GMT)
committerRoman Birg <roman@cyngn.com>2014-07-08 00:03:40 (GMT)
commit92921aa2f933c25f0d7bfee5f1bf506bd3a436ab (patch)
tree47bda5047a7d0bdceb500e314fa694d851720da7
parentbcd4d82ebdc6623a51ebc620f75aa8d0ee0f5957 (diff)
downloadandroid_packages_apps_Trebuchet-92921aa2f933c25f0d7bfee5f1bf506bd3a436ab.zip
android_packages_apps_Trebuchet-92921aa2f933c25f0d7bfee5f1bf506bd3a436ab.tar.gz
android_packages_apps_Trebuchet-92921aa2f933c25f0d7bfee5f1bf506bd3a436ab.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 9617ace..1fd4b1b 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1339,6 +1339,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();
@@ -1353,7 +1354,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);