TL;DR: I want to create a view that reacts to the movement of the map in the Google Maps API. Is there a way built into the Google Map APIs to sense if the Camera has completed movement?/Is there a way to detect of the Camera is stationary?
I am making an app that is designed much like the app Uber. In Uber there is a small popup bubble in the center of the screen that fades away when the map is in motion and comes back when it is stationary. I would like to duplicate that effect.
Here is the bubble in my app. It is defined in an xml layout that exists in a frameview with the map.

I have the animation functions working, I just need a way to sense the movement of the map.
I have found a way to see if a programatic movement of the camera has finished by assigning a CameraUpdateCallback, but I cannot find a way to have those callbacks assigned to normal, user-initiated, movement of the camera.
The alternative would be to crete a thread that checks the position of the camera every X milliseconds and fades in the bubble when the map position doesn't change, but that feels very "hacky" to me and seems to require extra processing that shouldn't be necessary.
Is there a way built into the Google Map APIs to sense if the Camera has completed movement?/Is there a way to detect of the Camera is stationary?
It's too late for answer but maybe help another person
just use
googleMap.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() {
@Override
public void onCameraIdle() {
Log.d(TAG, "onCameraIdle: ");
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With