Skip to content

Commit

Permalink
Fix the TouchEvent.MOVE error that causes wrong feedback when click a…
Browse files Browse the repository at this point in the history
…nd move out of the ActionButton
  • Loading branch information
Aracem committed Mar 6, 2015
1 parent e8a784a commit d8a0800
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fab/src/main/java/com/software/shell/fab/ActionButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -1013,9 +1013,16 @@ public boolean onTouchEvent(MotionEvent event) {
setState(State.PRESSED);
return true;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
Log.v(LOG_TAG, "Motion event action up detected");
setState(State.NORMAL);
return true;
case MotionEvent.ACTION_MOVE:
if (event.getX() < 0 || event.getX() > getWidth()
|| event.getY() < 0 ||event.getY() > getHeight()){
setState(State.NORMAL);
}
return true;
default:
Log.v(LOG_TAG, "Unrecognized motion event detected");
return false;
Expand Down

0 comments on commit d8a0800

Please sign in to comment.