Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import com.facebook.react.uimanager.RootView
import com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper
import com.swmansion.gesturehandler.react.RNGestureHandlerRootView
import java.util.*
Expand All @@ -14,6 +15,7 @@ class GestureHandlerOrchestrator(
private val wrapperView: ViewGroup,
private val handlerRegistry: GestureHandlerRegistry,
private val viewConfigHelper: ViewConfigurationHelper,
private val rootView: ViewGroup,
) {
/**
* Minimum alpha (value from 0 to 1) that should be set to a view so that it can be treated as a
Expand Down Expand Up @@ -56,6 +58,14 @@ class GestureHandlerOrchestrator(
if (finishedHandlersCleanupScheduled && handlingChangeSemaphore == 0) {
cleanupFinishedHandlers()
}
if (action == MotionEvent.ACTION_UP ||
action == MotionEvent.ACTION_CANCEL ||
action == MotionEvent.ACTION_HOVER_EXIT
) {
if (gestureHandlers.isEmpty() && rootView is RootView) {
rootView.onChildEndedNativeGesture(rootView, event)
}
}
return true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class RNGestureHandlerRootHelper(private val context: ReactContext, wrappedView:
wrappedView,
registry,
RNViewConfigurationHelper(),
rootView,
).apply {
minimumAlphaForTraversal = MIN_ALPHA_FOR_TOUCH
}
Expand Down