Introduction to Android Multi-Touch | by ZhangKe | Feb, 2022

Add gesture controls in your app

  • MotionEvent.ACTION_DOWN
    Tap the screen with the first finger
  • MotionEvent.ACTION_UP
    The last finger leaves the screen
  • MotionEvent.ACTION_MOVE
    A finger is swiping on the screen
  • MotionEvent.ACTION_CANCEL
    event blocked
    A finger already exists on the screen before the tap
    When one finger on the screen is lifted, there are still other fingers on the screen
float getX(int pointerIndex);
float getY(int pointerIndex);
float getHistoricalX(int pointerIndex, int pos);
int getHistorySize();

Leave a Comment