Skip to content

Commit acb9ac5

Browse files
committed
Small fixes
1 parent 6a08023 commit acb9ac5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

presentation/src/main/java/com/jorge/boats/xkcd/navigation/NavigationGestureDetector.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ public boolean onFling(final @NonNull MotionEvent e1, final @NonNull MotionEvent
6767
return false;
6868
}
6969

70-
if (!P.swipeControlNavigationEnabled.get() || !checkForNavigationSwipe(e1, e2)) {
7170

72-
final boolean isGestureStartingFromCorrectBezel = isPositionedOnRelevantEndBezel(e1);
73-
final boolean isLayoutExpandedAndThusIDontNeedTheGestureToStartFromTheBezel = mNavigationLayout.isExpanded();
71+
final boolean isGestureStartingFromCorrectBezel = isPositionedOnRelevantEndBezel(e1);
72+
final boolean isLayoutExpandedAndThusIDontNeedTheGestureToStartFromTheBezel = mNavigationLayout.isExpanded();
73+
74+
if (isLayoutExpandedAndThusIDontNeedTheGestureToStartFromTheBezel || isGestureStartingFromCorrectBezel || !P.swipeControlNavigationEnabled.get() || !checkForNavigationSwipe(e1, e2)) {
7475
final float start, end;
7576

7677
if (isLayoutExpandedAndThusIDontNeedTheGestureToStartFromTheBezel || isGestureStartingFromCorrectBezel) {
@@ -101,9 +102,9 @@ private boolean checkForNavigationSwipe(final @NonNull MotionEvent e1, final @No
101102
final float difference;
102103
if (Math.abs(difference = e2.getRawX() - e1.getRawX()) > mNavigationSwipeMinimumLength) {
103104
if (difference > 0) {
104-
mNavigationLayout.navigateToNext();
105-
} else {
106105
mNavigationLayout.navigateToPrevious();
106+
} else {
107+
mNavigationLayout.navigateToNext();
107108
}
108109
return true;
109110
}

0 commit comments

Comments
 (0)