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