summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2014-07-07 17:03:40 -0700
committerArne Coucheron <arco68@gmail.com>2016-02-16 21:46:07 +0100
commit58f05fa6e401815a68a22f62abb16fc935ecda88 (patch)
tree90e02595cfe2ddd0501885bcee2d77dc2575a7d8 /src
parent01b60e8bff4251f5bc850481d83c2ebe86f22b8a (diff)
downloadandroid_packages_apps_Trebuchet-58f05fa6e401815a68a22f62abb16fc935ecda88.zip
android_packages_apps_Trebuchet-58f05fa6e401815a68a22f62abb16fc935ecda88.tar.gz
android_packages_apps_Trebuchet-58f05fa6e401815a68a22f62abb16fc935ecda88.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
Diffstat (limited to 'src')
-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 c9fe247..4364e6b 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1387,6 +1387,7 @@ public class Workspace extends PagedView
// 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();
@@ -1401,7 +1402,8 @@ public class Workspace extends PagedView
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);