The best way to control Claude Code, Codex and more from any computer or phone
| 1 | diff --git a/android/src/main/java/expo/modules/ui/RNHostView.kt b/android/src/main/java/expo/modules/ui/RNHostView.kt |
| 2 | --- a/android/src/main/java/expo/modules/ui/RNHostView.kt |
| 3 | +++ b/android/src/main/java/expo/modules/ui/RNHostView.kt |
| 4 | @@ -847,7 +847,19 @@ |
| 5 | override fun setNestedScrollingEnabled(enabled: Boolean) { |
| 6 | childHelper.isNestedScrollingEnabled = enabled |
| 7 | } |
| 8 | - override fun isNestedScrollingEnabled(): Boolean = childHelper.isNestedScrollingEnabled |
| 9 | + // Relaying above only needs the helper's flag. Views that look for a scroll target, like |
| 10 | + // Material's BottomSheetBehavior, read this one, so a host of buttons must not claim to scroll. |
| 11 | + override fun isNestedScrollingEnabled(): Boolean = |
| 12 | + childHelper.isNestedScrollingEnabled && hasNestedScrollingDescendant(this) |
| 13 | + |
| 14 | + private fun hasNestedScrollingDescendant(group: ViewGroup): Boolean { |
| 15 | + for (index in 0 until group.childCount) { |
| 16 | + val child = group.getChildAt(index) |
| 17 | + if (child.isNestedScrollingEnabled) return true |
| 18 | + if (child is ViewGroup && hasNestedScrollingDescendant(child)) return true |
| 19 | + } |
| 20 | + return false |
| 21 | + } |
| 22 | override fun startNestedScroll(axes: Int): Boolean = childHelper.startNestedScroll(axes) |
| 23 | override fun startNestedScroll(axes: Int, type: Int): Boolean = childHelper.startNestedScroll(axes, type) |
| 24 | override fun stopNestedScroll() = childHelper.stopNestedScroll() |