Last active
February 28, 2020 14:19
-
-
Save abbas-oveissi/5ba0ee345acc5110fdfa1bb828ad3a11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onTouchEvent(MotionEvent event) { | |
int action = event.getActionMasked(); | |
float x = event.getX(); | |
float y = event.getY(); | |
switch (action) { | |
case MotionEvent.ACTION_DOWN: | |
startX = x; | |
startY = y; | |
break; | |
case MotionEvent.ACTION_UP: | |
break; | |
case MotionEvent.ACTION_MOVE: | |
currentX = x; | |
currentY = y; | |
invalidate(); | |
break; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment