summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2014-07-08 00:03:40 (GMT)
committerRoman Birg <roman@cyngn.com>2015-08-13 18:12:25 (GMT)
commit6fcb1c4bd0f44986a214c5714552c854d974a0dc (patch)
tree53bcce721ca11e96fd0bd79d12416d9ca684e5f5
parentb073b4937d3cd30ce0ff48d34ce68a9995baf3b6 (diff)
downloadandroid_packages_apps_Trebuchet-6fcb1c4bd0f44986a214c5714552c854d974a0dc.zip
android_packages_apps_Trebuchet-6fcb1c4bd0f44986a214c5714552c854d974a0dc.tar.gz
android_packages_apps_Trebuchet-6fcb1c4bd0f44986a214c5714552c854d974a0dc.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. Ref: QRDL-1001 Change-Id: Iccaedd742bed861fca1f50dd54e2e4537fd4c9b0 (cherry picked from commit 30f86c21b7513f2bed1009375ff5242c60661bf9)
-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 464b9b3..1cfa685 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1355,6 +1355,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();
@@ -1369,7 +1370,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);