mirror of
https://github.com/hanzoai/dev-desktop.git
synced 2026-11-20 01:07:23 +00:00
25 lines
1.4 KiB
Diff
25 lines
1.4 KiB
Diff
diff --git a/android/src/main/java/expo/modules/ui/RNHostView.kt b/android/src/main/java/expo/modules/ui/RNHostView.kt
|
|
--- a/android/src/main/java/expo/modules/ui/RNHostView.kt
|
|
+++ b/android/src/main/java/expo/modules/ui/RNHostView.kt
|
|
@@ -847,7 +847,19 @@
|
|
override fun setNestedScrollingEnabled(enabled: Boolean) {
|
|
childHelper.isNestedScrollingEnabled = enabled
|
|
}
|
|
- override fun isNestedScrollingEnabled(): Boolean = childHelper.isNestedScrollingEnabled
|
|
+ // Relaying above only needs the helper's flag. Views that look for a scroll target, like
|
|
+ // Material's BottomSheetBehavior, read this one, so a host of buttons must not claim to scroll.
|
|
+ override fun isNestedScrollingEnabled(): Boolean =
|
|
+ childHelper.isNestedScrollingEnabled && hasNestedScrollingDescendant(this)
|
|
+
|
|
+ private fun hasNestedScrollingDescendant(group: ViewGroup): Boolean {
|
|
+ for (index in 0 until group.childCount) {
|
|
+ val child = group.getChildAt(index)
|
|
+ if (child.isNestedScrollingEnabled) return true
|
|
+ if (child is ViewGroup && hasNestedScrollingDescendant(child)) return true
|
|
+ }
|
|
+ return false
|
|
+ }
|
|
override fun startNestedScroll(axes: Int): Boolean = childHelper.startNestedScroll(axes)
|
|
override fun startNestedScroll(axes: Int, type: Int): Boolean = childHelper.startNestedScroll(axes, type)
|
|
override fun stopNestedScroll() = childHelper.stopNestedScroll()
|