Skip to content

Commit e4b89e3

Browse files
Ph0tonicŁukasz Paczos
authored andcommitted
[annotation] Consume event when drag end to prevent click event
I wrote a seperate PR for this issue such as to simplify the review of #1125. - Fixes #883 Any review and comment would be much appreciated 👍 @LukasPaczos and @langsmith.
1 parent 47251ca commit e4b89e3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugin-annotation/src/main/java/com/mapbox/mapboxsdk/plugins/annotation/DraggableAnnotationController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ public DraggableAnnotationController(MapView mapView, MapboxMap mapboxMap,
5050
mapView.setOnTouchListener(new View.OnTouchListener() {
5151
@Override
5252
public boolean onTouch(View v, MotionEvent event) {
53+
Annotation oldAnnotation = draggedAnnotation;
5354
androidGesturesManager.onTouchEvent(event);
54-
// if drag is started, don't pass motion events further
55-
return draggedAnnotation != null;
55+
// if drag is started or drag is finished, don't pass motion events further
56+
return draggedAnnotation != null || oldAnnotation != draggedAnnotation;
5657
}
5758
});
5859
}

0 commit comments

Comments
 (0)