0
votes

I'm having a class that extends from SimpleOnGestureListener, in that class I got a method: public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY).

Now I can get the e1 and e2 coordinates and I can check what kind of gestures it is but is it possible to get the intermediate coordinates too?

1
I think it will be: MotionEvent ic = e1 + e2 /2;Ahmed Ekri
The + and / operator is undefined for the MotionEvent. But how does it give me the intermediate coordinates? As I see it this gives one X and Y?user1480139

1 Answers

0
votes

Found it myself:

    View testview = (View) findViewById(R.id.testView);

        // Set the touch listener for the main view to be our custom gesture listener
        testview.setOnTouchListener(new View.OnTouchListener() {
            public boolean onTouch(View v, MotionEvent event) {
                if(event.getAction() == MotionEvent.ACTION_MOVE)
                {
                    Log.d("Gestures","Moving...");
                }
            }