Adding margin to Drag layer instead of checking for right insets at every place

am: 9326461652

* commit '9326461652c36c2ddd888d1452cf7f075a391868':
  Adding margin to Drag layer instead of checking for right insets at every place
This commit is contained in:
Sunny Goyal
2015-12-01 22:49:42 +00:00
committed by android-build-merger
4 changed files with 33 additions and 19 deletions
+3 -8
View File
@@ -187,9 +187,6 @@ 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();
@@ -801,8 +798,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
childWidthMode = MeasureSpec.EXACTLY;
childHeightMode = MeasureSpec.EXACTLY;
childWidth = getViewportWidth() - mInsets.left
- (mIgnoreRightInset ? mInsets.right : 0);
childWidth = getViewportWidth() - mInsets.left - mInsets.right;
childHeight = getViewportHeight();
}
if (referenceChildWidth == 0) {
@@ -1157,9 +1153,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
getEdgeVerticalPostion(sTmpIntPoint);
int width = mIgnoreRightInset ? (display.width() - mInsets.right) : display.width();
canvas.translate(sTmpIntPoint[0] - display.top, -width);
mEdgeGlowRight.setSize(sTmpIntPoint[1] - sTmpIntPoint[0], width);
canvas.translate(sTmpIntPoint[0] - display.top, -display.width());
mEdgeGlowRight.setSize(sTmpIntPoint[1] - sTmpIntPoint[0], display.width());
if (mEdgeGlowRight.draw(canvas)) {
postInvalidateOnAnimation();
}