diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 116179370c2..2293c1b601d 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -7334,6 +7334,7 @@ public final class com/facebook/react/views/scroll/ScrollEventType$Companion { public class com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout : androidx/swiperefreshlayout/widget/SwipeRefreshLayout { public fun (Lcom/facebook/react/bridge/ReactContext;)V + public fun canChildScrollUp ()Z public fun onInterceptTouchEvent (Landroid/view/MotionEvent;)Z public fun onLayout (ZIIII)V public fun onTouchEvent (Landroid/view/MotionEvent;)Z diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java index b42143f3c12..5fe3af15fa0 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java @@ -8,6 +8,7 @@ package com.facebook.react.views.swiperefresh; import android.view.MotionEvent; +import android.view.View; import android.view.ViewConfiguration; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import com.facebook.infer.annotation.Nullsafe; @@ -72,6 +73,16 @@ public class ReactSwipeRefreshLayout extends SwipeRefreshLayout { } } + @Override + public boolean canChildScrollUp() { + View firstChild = getChildAt(0); + if (firstChild != null) { + return firstChild.canScrollVertically(-1); + } else { + return super.canChildScrollUp(); + } + } + /** * {@link SwipeRefreshLayout} overrides {@link ViewGroup#requestDisallowInterceptTouchEvent} and * swallows it. This means that any component underneath SwipeRefreshLayout will now interact