am 21d89fbf: Merge "Fixing overscroll effect when the navigation bar is opaque" into ub-launcher3-burnaby-polish

* commit '21d89fbf8c444c64a4c85d25a25bbe3b79719de9':
  Fixing overscroll effect when the navigation bar is opaque
This commit is contained in:
Sunny Goyal
2015-10-07 20:45:51 +00:00
committed by Android Git Automerger
4 changed files with 43 additions and 4 deletions

View File

@@ -187,6 +187,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();
@@ -798,7 +801,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) {
@@ -1152,8 +1156,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();
}