Skip to content

Commit 4a1a47a

Browse files
Merge pull request #5 from DB-boy/patch-2
Minor Updates and code Simplifications in EasyFlipView.java
2 parents 6ead536 + 2a19619 commit 4a1a47a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

EasyFlipView-Library/src/main/java/com/wajahatkarim3/easyflipview/EasyFlipView.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void flipTheView() {
149149
*/
150150
public void flipTheView(boolean withAnimation)
151151
{
152-
if (withAnimation == false)
152+
if (!withAnimation)
153153
{
154154
mSetLeftIn.setDuration(0);
155155
mSetRightOut.setDuration(0);
@@ -185,7 +185,7 @@ public boolean onTouchEvent(MotionEvent event) {
185185
float dx = x2 -x1;
186186
float dy = y2 -y1;
187187
float MAX_CLICK_DISTANCE = 0.5f;
188-
if(dx < MAX_CLICK_DISTANCE && dy < MAX_CLICK_DISTANCE && dx >= 0 && dy >= 0)
188+
if ((dx>= 0 && dx<MAX_CLICK_DISTANCE)&&(dy>= 0&& dy<MAX_CLICK_DISTANCE))
189189
{
190190
flipTheView();
191191
}
@@ -195,7 +195,6 @@ public boolean onTouchEvent(MotionEvent event) {
195195
else {
196196
return super.onTouchEvent(event);
197197
}
198-
return false;
199198
}
200199

201200
/**

0 commit comments

Comments
 (0)