-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Camera Change Listener v2.0 #8644
Camera Change Listener v2.0 #8644
Conversation
8aea249
to
a7a2a39
Compare
a7a2a39
to
328f898
Compare
I took another stab at optimizing the onFling integration. This PR is now ready for review. |
55e77a1
to
2a3da10
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.
👍
|
||
@Override | ||
public void onCameraMoveStarted(int reason) { | ||
if (!idle) { |
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.
I personally prefer one-liner guard clauses but it's a matter of taste.
IMO a one-liner guard clause makes your intention clearer.
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.
I don't a preference for one or the other, will fix this up.
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.
ah, checkstyle doesn't approve this.. [ant:checkstyle] [ERROR] /home/tvn/Mapbox/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/CameraChangeDispatcher.java:36: 'if' construct must use '{}'s. [NeedBraces]
Feel free to ticket out changing this setting and doing a cleanup of the codebase.
@@ -466,7 +478,7 @@ public boolean onScale(ScaleGestureDetector detector) { | |||
} | |||
|
|||
// Cancel any animation | |||
transform.cancelTransitions(); | |||
//transform.cancelTransitions(); |
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.
Why not removing commented code?
@@ -634,7 +647,7 @@ public boolean onShove(ShoveGestureDetector detector) { | |||
} | |||
|
|||
// Cancel any animation | |||
transform.cancelTransitions(); | |||
//transform.cancelTransitions(); |
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.
Same here.
public void onMapChanged(int change) { | ||
Timber.e("CHANGE : %s", change); | ||
if (change == MapView.REGION_DID_CHANGE_ANIMATED) { | ||
mapView.removeOnMapChangedListener(this); |
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.
Wondering if it order matters 🤔
In setZoom
is defined mapView.removeOnMapChangedListener
and cameraChangeDispatcher.onCameraIdle
second but in moveBy
is defined the other way around.
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.
doesn't change behavior, but for consistency will pick that up.
2a3da10
to
6fddb8d
Compare
Closes #6350.