-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Move MarkerView click handling back to View#setOnClickListener #8272
Move MarkerView click handling back to View#setOnClickListener #8272
Conversation
…kListener. Workaround panning issue by dispatching touch events to the parent ViewGroup.
@@ -503,6 +503,21 @@ public void invalidateViewMarkersInVisibleRegion() { | |||
} | |||
} | |||
|
|||
adaptedView.setOnClickListener(new View.OnClickListener() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought, we should refactor invalidateViewMarkersInVisibleRegion
method. The longer a procedure is, the more difficult it’s to understand. It's an easy refactor, 99% of the times extract a method. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this has been on my list todo for a while, this method should be split up into smaller methods 👍
if (marker instanceof MarkerView) { | ||
handledDefaultClick = markerViewManager.onClickMarkerView((MarkerView) marker); | ||
} else { | ||
if (!(marker instanceof MarkerView)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should refactor AnnotationManager
class (actually I'm working on it 😅 ). It has a lot of responsibilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, looking forward to that PR ;)
* Revert "[android] - only dispatch events if not handled by MarkerView (#8447)" This reverts commit 09d7685. * Revert "[android] - move touch handling of MarkerViews back to View#setOnClickListener. Workaround panning issue by dispatching touch events to the parent ViewGroup. (#8272)" This reverts commit 1693b38.
Closes #8236, refs # 8159 #5388 #5639
This PR moves touch handling of MarkerViews back to View#setOnClickListener and fixes the issue with the original implementation as shown in #5388.
This change is motivated by 2 items: