From 8086d1db46e5adcd87ffad105addfb8b9b15e0bd Mon Sep 17 00:00:00 2001 From: Mohamed Ezzat Date: Wed, 25 May 2016 00:09:38 +0200 Subject: [PATCH] squid:SwitchLastCaseIsDefaultCheck - switch statements should end with a default clause (#306) --- .../pager/vertical/VerticalViewPagerImpl.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/vertical/VerticalViewPagerImpl.java b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/vertical/VerticalViewPagerImpl.java index 10e6fd1713..a2ef17fda0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/vertical/VerticalViewPagerImpl.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/vertical/VerticalViewPagerImpl.java @@ -1567,9 +1567,6 @@ public class VerticalViewPagerImpl extends ViewGroup { final int hgrav = lp.gravity & Gravity.HORIZONTAL_GRAVITY_MASK; final int vgrav = lp.gravity & Gravity.VERTICAL_GRAVITY_MASK; switch (hgrav) { - default: - childLeft = paddingLeft; - break; case Gravity.LEFT: childLeft = paddingLeft; paddingLeft += child.getMeasuredWidth(); @@ -1582,11 +1579,11 @@ public class VerticalViewPagerImpl extends ViewGroup { childLeft = width - paddingRight - child.getMeasuredWidth(); paddingRight += child.getMeasuredWidth(); break; + default: + childLeft = paddingLeft; + break; } switch (vgrav) { - default: - childTop = paddingTop; - break; case Gravity.TOP: childTop = paddingTop; paddingTop += child.getMeasuredHeight(); @@ -1599,6 +1596,9 @@ public class VerticalViewPagerImpl extends ViewGroup { childTop = height - paddingBottom - child.getMeasuredHeight(); paddingBottom += child.getMeasuredHeight(); break; + default: + childTop = paddingTop; + break; } childTop += scrollY; child.layout(childLeft, childTop, @@ -1733,9 +1733,6 @@ public class VerticalViewPagerImpl extends ViewGroup { final int vgrav = lp.gravity & Gravity.VERTICAL_GRAVITY_MASK; int childTop; switch (vgrav) { - default: - childTop = paddingTop; - break; case Gravity.TOP: childTop = paddingTop; paddingTop += child.getHeight(); @@ -1748,6 +1745,9 @@ public class VerticalViewPagerImpl extends ViewGroup { childTop = height - paddingBottom - child.getMeasuredHeight(); paddingBottom += child.getMeasuredHeight(); break; + default: + childTop = paddingTop; + break; } childTop += scrollY; @@ -1999,6 +1999,8 @@ public class VerticalViewPagerImpl extends ViewGroup { case MotionEventCompat.ACTION_POINTER_UP: onSecondaryPointerUp(ev); break; + default: + break; } if (mVelocityTracker == null) { @@ -2133,6 +2135,8 @@ public class VerticalViewPagerImpl extends ViewGroup { mLastMotionY = MotionEventCompat.getY(ev, MotionEventCompat.findPointerIndex(ev, mActivePointerId)); break; + default: + break; } if (needsInvalidate) { ViewCompat.postInvalidateOnAnimation(this); @@ -2606,6 +2610,8 @@ public class VerticalViewPagerImpl extends ViewGroup { } } break; + default: + break; } } return handled; @@ -2905,6 +2911,8 @@ public class VerticalViewPagerImpl extends ViewGroup { return true; } } return false; + default: + break; } return false; }