mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.34k stars 1.33k forks source link

Shove / Tilt gesture unreliable on Android #16659

Closed stevehayles closed 1 year ago

stevehayles commented 1 year ago

Platform: Android Mapbox SDK version: 10.9.1

Steps to trigger behavior

  1. Running on Android 13 and Pixel 5
  2. Running a minimal sample, with a simple map
  3. Use the two finger vertical shove gesture to tilt the map

Expected behavior

The two finger vertical gesture should reliably be recognised

Actual behavior

Quite regularly (about 20% of my attempts) the two finger shove gesture isn't recognised correctly and the map 'moves' rather than tilts.

stevehayles commented 1 year ago

If I comment out this line in MapGestureDector.java and allow the threshold to fall back to what appears to be the default of 15.3f in the Mapbox Gestures library this problem goes away.

I will try exposing the 'setAngleThreshold' method of the rotateGestureDetector to my application code and setting it to a higher threshold, as it seems wrong to be forking this repo to remove a single line. I am not clear on how I would be sure that the previously mentioned call in 'initializeGesturesManager' of the MapGestureDetector has already be run to ensure that the setting of the threshold is done in the right order..

stevehayles commented 1 year ago

Closing as fixable from application code