So I'm not sure if this is a mistake or not yet ... maybe, or I may have missed something.
Anyway, here is a link to Google Maps V2 Camera Controls. https://developers.google.com/maps/documentation/android/views#moving_the_camera
Problem:
Animation to an already animated position does not call onFinish ();
How to replicate:
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(mLocation.getLatLng(), zoomLevel), 200, new GoogleMap.CancelableCallback() { @Override public void onFinish() { //DO some stuff here! Log.d("animation", "onFinishCalled"); } @Override public void onCancel() { Log.d("animation", "onCancel"); } });
This problem can occur when the user types twice what is called the same animation, even if there is a lot of time between them, onFinish will be called only for successful animation. When the camera is already installed, the onFinish method will not be called!
I could do the checks before doing the camera animation, but I don't like it as wasteful.
Any help would be greatly appreciated. Thanks.
android animation camera google-maps-api-2
Aiden fry
source share