-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Detecting complete end of motion on Android in 5.0.0 #8515
Comments
@Jukurrpa Thank you for reaching out and taking time to write up your issue. You should though be able to detect the map being idle using the OnMapChangeListener and setting up an idle timeout that is triggered when the map hasn't received any changes during the timeout period. Can you let me know which MapChange events you are currently hooking into? Additionally we are thinking about improving our OnCameraChangeListener with callbacks that indicate which kind of interaction occurred in #6350. To close this issue, I think it would be a good idea to either add an example of this in the testapp of this repository or in mapbox-android-demo. |
Hey @tobrun, I have more or less similar problem. Right now on I found some listeners:
It's still not enough - probably I can't get information when touch ended. Do you have any sugestion how can I resolved my problem without many hacks? Maybe it's (I haven't found the way) or would be possible to register custom listener for GestureDetector? Having tl;dr
|
The PRs responsible for this change will be #8272 in combination with #8447. If you are not using MarkerViews atm you can workaround this by toggling the visibility of the MarkerViewContainer. with |
Any suggestion for my problem to avoid duplicate issue? Actually it's not related to any element of map. |
@tobrun thanks for the answer and clearing up the I'm using these events in Using a timer works indeed but adds an artificial waiting time for the user in addition to whatever is done when the map stops moving (http request in my case), which is not great even if it's a couple of tenths of second. The changes on Not sure how I can contribute as I don't have much free time to work on the SDK itself, but I can share what I'll put together using a timer, even if it's not a perfect solution. |
Thanks for the update, looking forward to the 5.1.0! |
Platform: Android
Mapbox SDK version: 5.0.0
I'd like to detect complete end of motion of the camera on the Android SDK (no camera movement, no user interaction). For this I've tried combining several things such as
OnMapChangedListener
with different states,OnCameraChangeListener
,OnScrollListener
,OnFlingListener
as well as anOnTouchListener
.On v4.2.2 I managed to get something that somewhat does the job with just
OnMapChangedListener
andOnTouchListener
as I described in this stackoverflow question. Basically the remaining issue was that the chaining of events implies there is a complete stop when the user stops touching the screen and the fling inertia kicks in:With the version 5.0.0 of the SDK the
OnTouchListener
became unusable as theMapView
always consumes the event, which forces me to add a dummy overlayView
above theMapView
just to intercept touch down/up events. Not super clean, especially for a method that doesn't completely solve my problem.Is there an alternative to achieve what I'm looking for, such as a listener I missed?
The text was updated successfully, but these errors were encountered: