2013-11-04 5 views
0

SimpleOnGestureListener에서 확장되는 클래스가 있는데 그 클래스에서 메서드가 있습니다. public boolean onFling (MotionEvent e1, MotionEvent e2, float velocityX, float velocityY).중간 좌표 얻기

이제 e1과 e2 좌표를 얻을 수 있으며 어떤 제스처인지 확인할 수 있지만 중간 좌표도 얻을 수 있습니까?

+0

내가이 될 것이라고 생각 : MotionEvent IC = E1 + E2/2; –

+0

+ 및/연산자는 MotionEvent에 대해 정의되지 않습니다. 그러나 중간 좌표를 어떻게 내게 줄 수 있습니까? 내가보기에 이것은 하나의 X와 Y를 제공합니까? – user1480139

답변

0

이에게 자신을 찾았

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..."); 
       } 
      }