File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
android/src/main/java/com/mjstudio/reactnativenavermap/mapview Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import android.annotation.SuppressLint
4
4
import android.os.Bundle
5
5
import android.view.Choreographer
6
6
import android.view.Choreographer.FrameCallback
7
+ import android.view.MotionEvent
7
8
import android.view.View
8
9
import android.widget.FrameLayout
9
10
import com.facebook.react.bridge.LifecycleEventListener
@@ -95,6 +96,26 @@ class RNCNaverMapViewWrapper(
95
96
96
97
override fun onHostDestroy () {}
97
98
99
+ override fun dispatchTouchEvent (ev : MotionEvent ? ): Boolean {
100
+ mapView?.withMap { map ->
101
+ if (map.uiSettings.isScrollGesturesEnabled) {
102
+ when (ev?.action) {
103
+ MotionEvent .ACTION_DOWN ,
104
+ MotionEvent .ACTION_MOVE ,
105
+ -> {
106
+ parent?.requestDisallowInterceptTouchEvent(true )
107
+ }
108
+ MotionEvent .ACTION_UP ,
109
+ MotionEvent .ACTION_CANCEL ,
110
+ -> {
111
+ parent?.requestDisallowInterceptTouchEvent(false )
112
+ }
113
+ }
114
+ }
115
+ }
116
+ return super .dispatchTouchEvent(ev)
117
+ }
118
+
98
119
companion object {
99
120
/* *
100
121
* A helper to get react tag id by given MapView
You can’t perform that action at this time.
0 commit comments