Restore parallax even if Google Now isn't present
- Also fix a crash when choosing third-party wallpaper pickers Bug: 11008122 Change-Id: Ie5923fdadc1db6facf695ec05522f5e469d6c72a
This commit is contained in:
1 parent
61f560d92a
commit
16205da30e
3 files changed
+15
-10
No files matched your search
@@ -1070,7 +1070,6 @@ public class Workspace extends SmoothPagedView
|
||||
class WallpaperOffsetInterpolator implements Choreographer.FrameCallback {
|
||||
float mFinalOffset = 0.0f;
|
||||
float mCurrentOffset = 0.5f; // to force an initial update
|
||||
//long mLastWallpaperOffsetUpdateTime;
|
||||
boolean mWaitingForUpdate;
|
||||
Choreographer mChoreographer;
|
||||
Interpolator mInterpolator;
|
||||
@@ -1135,10 +1134,12 @@ public class Workspace extends SmoothPagedView
|
||||
}
|
||||
|
||||
// Exclude the leftmost page
|
||||
final int firstIndex = isLayoutRtl() ? getChildCount() - 2 : 1;
|
||||
final int startPage = hasCustomContent() ? 1 : 0;
|
||||
final int firstIndex = isLayoutRtl() ? getChildCount() - 1 - startPage : startPage;
|
||||
// Exclude the last extra empty screen (if we have > MIN_PARALLAX_PAGE_SPAN pages)
|
||||
int extra = numExtraScreensToIgnore();
|
||||
final int lastIndex = isLayoutRtl() ? 0 + extra : getChildCount() - 1 - extra;
|
||||
int emptyExtraPages = numExtraScreensToIgnore();
|
||||
final int lastIndex =
|
||||
isLayoutRtl() ? 0 + emptyExtraPages : getChildCount() - 1 - emptyExtraPages;
|
||||
|
||||
int firstPageScrollX = getScrollForPage(firstIndex);
|
||||
int scrollRange = getScrollForPage(lastIndex) - firstPageScrollX;
|
||||
@@ -1166,7 +1167,8 @@ public class Workspace extends SmoothPagedView
|
||||
}
|
||||
|
||||
private int getNumScreensExcludingExtraEmptyScreenAndLeftmost() {
|
||||
int numScrollingPages = getChildCount() - 1 - numExtraScreensToIgnore();
|
||||
int numScrollingPages = getChildCount() - numExtraScreensToIgnore();
|
||||
if (hasCustomContent()) numScrollingPages -= 1;
|
||||
return numScrollingPages;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user