Skip to content

Conversation

@afarber
Copy link
Owner

@afarber afarber commented Nov 28, 2025

Fix bug where map dragging was incorrectly registered as clicks in Android Automotive emulator.

Problem

During map dragging, the movement distance calculation in ACTION_UP was measuring from the last ACTION_MOVE position instead of the initial ACTION_DOWN position. This
caused long drags to be misinterpreted as clicks.

Solution

  • Add initialTouchX and initialTouchY fields to OpenMapView.kt to capture the initial touch position in ACTION_DOWN handler
  • Change click detection in ACTION_UP to use initial position instead of last position
  • Add instrumentation tests (TouchGestureInstrumentationTest.kt) to verify:
    • Long drags (200px) are NOT registered as clicks
    • Small movements (3px) ARE registered as clicks

@afarber afarber merged commit d79a263 into main Nov 28, 2025
10 checks passed
@afarber afarber deleted the fix-drag-registered-as-click branch November 28, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants