release handle to android native MotionEvent
This commit is contained in:
parent
98ea108b22
commit
9ff8e149ef
@ -120,7 +120,9 @@ public class MapView extends RelativeLayout {
|
|||||||
mGestureDetector = new GestureDetector(context, new OnGestureListener() {
|
mGestureDetector = new GestureDetector(context, new OnGestureListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onSingleTapUp(MotionEvent e) {
|
public boolean onSingleTapUp(MotionEvent e) {
|
||||||
return mMap.handleGesture(Gesture.TAP, mMotionEvent.wrap(e));
|
boolean handled = mMap.handleGesture(Gesture.TAP, mMotionEvent.wrap(e));
|
||||||
|
mMotionEvent.wrap(null);
|
||||||
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -135,6 +137,7 @@ public class MapView extends RelativeLayout {
|
|||||||
@Override
|
@Override
|
||||||
public void onLongPress(MotionEvent e) {
|
public void onLongPress(MotionEvent e) {
|
||||||
mMap.handleGesture(Gesture.LONG_PRESS, mMotionEvent.wrap(e));
|
mMap.handleGesture(Gesture.LONG_PRESS, mMotionEvent.wrap(e));
|
||||||
|
mMotionEvent.wrap(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -144,7 +147,9 @@ public class MapView extends RelativeLayout {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onDown(MotionEvent e) {
|
public boolean onDown(MotionEvent e) {
|
||||||
return mMap.handleGesture(Gesture.PRESS, mMotionEvent.wrap(e));
|
boolean handled = mMap.handleGesture(Gesture.PRESS, mMotionEvent.wrap(e));
|
||||||
|
mMotionEvent.wrap(null);
|
||||||
|
return handled;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -207,8 +212,8 @@ public class MapView extends RelativeLayout {
|
|||||||
if (mGestureDetector.onTouchEvent(motionEvent))
|
if (mGestureDetector.onTouchEvent(motionEvent))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
mMotionEvent.wrap(motionEvent);
|
mMap.handleMotionEvent(mMotionEvent.wrap(motionEvent));
|
||||||
mMap.handleMotionEvent(mMotionEvent);
|
mMotionEvent.wrap(null);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user