Skip to content

Commit

Permalink
Merge pull request #974 from TBog/fling_direction
Browse files Browse the repository at this point in the history
Fix onFling direction
  • Loading branch information
Neamar authored May 4, 2018
2 parents 0efd5ea + d7cfcec commit faace6a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ public boolean onSingleTapUp(MotionEvent e) {

@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
float direction = e2.getY() - e1.getY();
if(direction > 0) {
float directionY = e2.getY() - e1.getY();
float directionX = e2.getX() - e1.getX();
if ( Math.abs(directionX) > Math.abs(directionY) )
return false;
if(directionY > 0) {
// Fling down: display notifications
displayNotificationDrawer();
}
Expand Down

0 comments on commit faace6a

Please sign in to comment.