Extract common parts from if statements
This commit is contained in:
parent
5072e34900
commit
9eeebc67ee
|
@ -409,14 +409,12 @@ public class HeaderDrawerLayout extends ViewGroup {
|
|||
if (dy > 0 && mDrawer.canScrollCallback(-dy) && mDrawer.isTouchingScrollableContent()) {
|
||||
if (!mDrawer.isUsingDragHelper()) {
|
||||
// Scrolling up while list still has space to scroll, so make header still
|
||||
mScrollingHeaderByHelper = false;
|
||||
return current;
|
||||
} else {
|
||||
mDrawer.scrollByCallback(-dy);
|
||||
}
|
||||
mScrollingHeaderByHelper = false;
|
||||
return current;
|
||||
}
|
||||
}
|
||||
final int min = mDrawer.getHeaderTopMinimum(), max = mDrawer.getHeaderTopMaximum();
|
||||
if (top < min && mDrawer.isTouchingScrollableContent() && mDrawer.isUsingDragHelper()) {
|
||||
mDrawer.scrollByCallback(-dy);
|
||||
|
|
|
@ -196,17 +196,14 @@ public class ShapedImageView extends AppCompatImageView {
|
|||
contentHeight = contentBottom - contentTop;
|
||||
final int size = Math.min(contentWidth, contentHeight);
|
||||
|
||||
if (OUTLINE_DRAW) {
|
||||
drawShape(canvas, mDestination, 0, mBackgroundPaint);
|
||||
super.onDraw(canvas);
|
||||
} else {
|
||||
if (!OUTLINE_DRAW) {
|
||||
if (mShadowBitmap != null && mDrawShadow) {
|
||||
canvas.drawBitmap(mShadowBitmap, contentLeft + (contentWidth - size) / 2 - mShadowRadius,
|
||||
contentTop + (contentHeight - size) / 2 - mShadowRadius, null);
|
||||
}
|
||||
}
|
||||
drawShape(canvas, mDestination, 0, mBackgroundPaint);
|
||||
super.onDraw(canvas);
|
||||
}
|
||||
// Then draw the border.
|
||||
if (mBorderEnabled) {
|
||||
drawBorder(canvas, mDestination);
|
||||
|
|
Loading…
Reference in New Issue