-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Replace OnMapChange with specific callbacks #13050
Conversation
@LukasPaczos this PR is ready for review:
|
89fc4fc
to
492a64d
Compare
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.
LGTM! Only changes requested are fixups for a couple of refactor artifacts.
@@ -159,7 +159,7 @@ void onRestoreInstanceState(@NonNull Bundle savedInstanceState) { | |||
} | |||
|
|||
/** | |||
* Called when the hosting Activity/Fragment onDestroy()/onDestroyView() method is called. | |||
* Called when the hosting Activity/Fragment clear()/onDestroyView() method is called. |
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.
Refactor artifact.
@@ -116,7 +122,7 @@ private boolean checkState(String callingMethod) { | |||
// validate if map has already been destroyed | |||
if (destroyed && !TextUtils.isEmpty(callingMethod)) { | |||
String message = String.format( | |||
"You're calling `%s` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", | |||
"You're calling `%s` after the `MapView` was destroyed, were you invoking it after `clear()`?", |
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.
Refactor artifact.
@@ -417,11 +422,12 @@ public void onStop() { | |||
} | |||
|
|||
/** | |||
* You must call this method from the parent's Activity#onDestroy() or Fragment#onDestroyView(). | |||
* You must call this method from the parent's Activity#clear() or Fragment#onDestroyView(). |
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.
Refactor artifact.
492a64d
to
80ec30d
Compare
double checked refactor artefacts and should be addressed with 80ec30d |
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.
🚀
PR introduces separate callbacks for all the map change events instead of wiring them through the same OnMapChange callback. This avoids iterating all registered listener and limits the invocations of those callbacks for non-related events.
This PR also aligns naming of callbacks to match core naming more closely:
Todo:
native_map_view.cpp
changesReplaces obsolete closed PR in #9498.