Skip to content

Commit 482bdaa

Browse files
committed
Fixed some crashes
1 parent 16de556 commit 482bdaa

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/android/app/src/main/java/com/reactnativenavigation/views/touch/OverlayTouchDelegate.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ open class OverlayTouchDelegate(
4747
private fun isInsideView(event: MotionEvent): Boolean {
4848
val reactViewSurface = this.reactView.getChildAt(0) as ViewGroup
4949
for (i in 0 until reactViewSurface.childCount) {
50-
val childViewGroup = reactViewSurface.getChildAt(i) as ViewGroup
50+
val childItem = reactViewSurface.getChildAt(i)
5151

52-
if (childViewGroup.getChildAt(0) is DebuggingOverlay) {
53-
continue
52+
if (childItem is ViewGroup) {
53+
if (childItem.getChildAt(0) is DebuggingOverlay) {
54+
continue
55+
}
5456
}
5557

56-
if (childViewGroup.isVisible && event.coordinatesInsideView(childViewGroup)) {
58+
if (childItem.isVisible && event.coordinatesInsideView(childItem)) {
5759
return true
5860
}
5961
}

0 commit comments

Comments
 (0)