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 @@ -624,7 +624,7 @@ class GestureHandlerOrchestrator(

val childrenCount = viewGroup.childCount
for (i in childrenCount - 1 downTo 0) {
Comment thread
j-piasecki marked this conversation as resolved.
val child = viewConfigHelper.getChildInDrawingOrderAtIndex(viewGroup, i)
val child = viewGroup.getChildAt(i)
if (canReceiveEvents(child)) {
val childPoint = tempPoint
transformPointToChildViewCoords(coords[0], coords[1], viewGroup, child, childPoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper
import com.swmansion.gesturehandler.react.RNViewConfigurationHelper
import com.swmansion.gesturehandler.react.events.eventbuilders.HoverGestureHandlerEventDataBuilder

class HoverGestureHandler : GestureHandler() {
Expand Down Expand Up @@ -44,7 +43,7 @@ class HoverGestureHandler : GestureHandler() {

if (rootView is ViewGroup) {
for (i in 0 until rootView.childCount) {
Comment thread
j-piasecki marked this conversation as resolved.
val child = viewConfigHelper.getChildInDrawingOrderAtIndex(rootView, i)
val child = rootView.getChildAt(i)
return isViewDisplayedOverAnother(view, other, child) ?: continue
}
}
Expand Down Expand Up @@ -145,8 +144,4 @@ class HoverGestureHandler : GestureHandler() {

override fun createEventBuilder(handler: HoverGestureHandler) = HoverGestureHandlerEventDataBuilder(handler)
}

companion object {
private val viewConfigHelper = RNViewConfigurationHelper()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ import android.view.ViewGroup

interface ViewConfigurationHelper {
fun getPointerEventsConfigForView(view: View): PointerEventsConfig
fun getChildInDrawingOrderAtIndex(parent: ViewGroup, index: Int): View
fun isViewClippingChildren(view: ViewGroup): Boolean
Comment thread
j-piasecki marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ class RNViewConfigurationHelper : ViewConfigurationHelper {
}
}

override fun getChildInDrawingOrderAtIndex(parent: ViewGroup, index: Int): View = if (parent is ReactViewGroup) {
parent.getChildAt(parent.getZIndexMappedChildIndex(index))
} else {
parent.getChildAt(index)
}

override fun isViewClippingChildren(view: ViewGroup) = when {
view.clipChildren -> true
view is ReactScrollView -> view.overflow != "visible"
Expand Down
Loading