From 72ffa4974c6ade800f3ce9d9247a693be1954ab4 Mon Sep 17 00:00:00 2001 From: Mike Lambert Date: Mon, 31 Oct 2016 16:32:56 -0400 Subject: [PATCH] If we've disabled scrolling within the map, then don't capture the touch events (#664) * If we've disabled scrolling within the map, then don't capture the touch events. This allows the containing scrollview to perform a scrollview scroll by dragging on the map. (Previously, the map would absorb the touches, and then not scroll the map *or* the scrollview, which was bad.) * Minor simplification --- .../main/java/com/airbnb/android/react/maps/AirMapView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java b/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java index e381757c83..01fabe3582 100644 --- a/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java +++ b/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java @@ -571,13 +571,15 @@ public boolean dispatchTouchEvent(MotionEvent ev) { switch (action) { case (MotionEvent.ACTION_DOWN): - this.getParent().requestDisallowInterceptTouchEvent(true); + this.getParent().requestDisallowInterceptTouchEvent( + map != null && map.getUiSettings().isScrollGesturesEnabled()); isTouchDown = true; break; case (MotionEvent.ACTION_MOVE): startMonitoringRegion(); break; case (MotionEvent.ACTION_UP): + // Clear this regardless, since isScrollGesturesEnabled() may have been updated this.getParent().requestDisallowInterceptTouchEvent(false); isTouchDown = false; break;