diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-06-23 10:53:59 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-09-22 10:57:08 -0700 |
commit | 0abb36f6920733f813e22ad984bb7d48f0924698 (patch) | |
tree | be6a5192fa9cd12da78f82f623a756a13ddc45af /src/com/android/launcher3/PagedView.java | |
parent | 9ae42fff6f481ea2a06f171da43f630ded313b69 (diff) | |
download | android_packages_apps_Trebuchet-0abb36f6920733f813e22ad984bb7d48f0924698.tar.gz android_packages_apps_Trebuchet-0abb36f6920733f813e22ad984bb7d48f0924698.tar.bz2 android_packages_apps_Trebuchet-0abb36f6920733f813e22ad984bb7d48f0924698.zip |
Fixing overscroll effect when the navigation bar is opaque
The navigation bar is opaque on mobile devices in landscape mode.
Launcher should ignore the right insets and draw the edge effect appropriately.
Also draw the black bar under the navigation bar, just in case we assume it
to be opaque, but it was not actually opaque.
Bug: 18526657
Change-Id: I1d49dcb82b8a5ee25009bc738cd9b8c0c5c88263
Diffstat (limited to 'src/com/android/launcher3/PagedView.java')
-rw-r--r-- | src/com/android/launcher3/PagedView.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 05f0a0553..2579ea363 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -202,6 +202,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc protected final Rect mInsets = new Rect(); protected final boolean mIsRtl; + // When set to true, full screen content and overscroll effect is shited inside by right inset. + protected boolean mIgnoreRightInset; + // Edge effect private final LauncherEdgeEffect mEdgeGlowLeft = new LauncherEdgeEffect(); private final LauncherEdgeEffect mEdgeGlowRight = new LauncherEdgeEffect(); @@ -819,7 +822,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc childWidthMode = MeasureSpec.EXACTLY; childHeightMode = MeasureSpec.EXACTLY; - childWidth = getViewportWidth() - mInsets.left - mInsets.right; + childWidth = getViewportWidth() - mInsets.left + - (mIgnoreRightInset ? mInsets.right : 0); childHeight = getViewportHeight(); } if (referenceChildWidth == 0) { @@ -1177,8 +1181,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc canvas.rotate(90); getEdgeVerticalPostion(sTmpIntPoint); - canvas.translate(sTmpIntPoint[0] - display.top, -display.width()); - mEdgeGlowRight.setSize(sTmpIntPoint[1] - sTmpIntPoint[0], display.width()); + + int width = mIgnoreRightInset ? (display.width() - mInsets.right) : display.width(); + canvas.translate(sTmpIntPoint[0] - display.top, -width); + mEdgeGlowRight.setSize(sTmpIntPoint[1] - sTmpIntPoint[0], width); if (mEdgeGlowRight.draw(canvas)) { postInvalidateOnAnimation(); } |