Avoid nudging transitions if a gesture is in progress
We're now using nudgeTransitions() to tell the Map view that we want to update it. However, if we're on a gesture movement, the update() call can get called too fast and causing general slowdown. This check ensures we only call for nudgeTransitions() after all gesture events are finished. Fixes the issue pointed out by #1548 on Android.
This commit is contained in:
@@ -1268,7 +1268,8 @@ public class MapView extends SurfaceView {
|
||||
post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mNativeMapView.invalidate();
|
||||
boolean inProgress = mRotateGestureDetector.isInProgress() || mScaleGestureDetector.isInProgress();
|
||||
mNativeMapView.invalidate(inProgress);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ class NativeMapView {
|
||||
nativeUpdate(mNativeMapViewPtr);
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
nativeOnInvalidate(mNativeMapViewPtr);
|
||||
public void invalidate(boolean inProgress) {
|
||||
nativeOnInvalidate(mNativeMapViewPtr, inProgress);
|
||||
}
|
||||
|
||||
public void resizeView(int width, int height) {
|
||||
@@ -438,7 +438,7 @@ class NativeMapView {
|
||||
|
||||
private native void nativeUpdate(long nativeMapViewPtr);
|
||||
|
||||
private native void nativeOnInvalidate(long nativeMapViewPtr);
|
||||
private native void nativeOnInvalidate(long nativeMapViewPtr, boolean inProgress);
|
||||
|
||||
private native void nativeViewResize(long nativeMapViewPtr, int width, int height);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user