From 428c563c75c9da6e055a1dc7268c461f0d9bf6c2 Mon Sep 17 00:00:00 2001 From: Konstantin Raev Date: Thu, 12 May 2016 04:49:35 -0700 Subject: [PATCH] Revert "Fix RefreshControl race condition" Summary: This reverts commit 8fbce3099dca2340eaa614e9a90bb89a4a386bb9. Reverts https://github.com/facebook/react-native/pull/7317 because it breaks instrumentation tests https://circleci.com/gh/facebook/react-native/6521 Closes https://github.com/facebook/react-native/pull/7529 Differential Revision: D3292461 fbshipit-source-id: 7dcde05adefe41e6b3c28697fccfa232a45f0742 --- .../swiperefresh/ReactSwipeRefreshLayout.java | 17 ----------------- .../swiperefresh/SwipeRefreshLayoutManager.java | 11 +++++++++-- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java b/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java index 728def66f..f458c0ab0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.java @@ -20,27 +20,10 @@ import com.facebook.react.uimanager.events.NativeGestureUtil; */ public class ReactSwipeRefreshLayout extends SwipeRefreshLayout { - private boolean mRefreshing = false; - public ReactSwipeRefreshLayout(ReactContext reactContext) { super(reactContext); } - @Override - public void setRefreshing(boolean refreshing) { - if (mRefreshing != refreshing) { - mRefreshing = refreshing; - // Use `post` otherwise the control won't start refreshing if refreshing is true when - // the component gets mounted. - post(new Runnable() { - @Override - public void run() { - ReactSwipeRefreshLayout.super.setRefreshing(mRefreshing); - } - }); - } - } - @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (super.onInterceptTouchEvent(ev)) { diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager.java index e66132ff7..5db04a1a7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager.java @@ -74,8 +74,15 @@ public class SwipeRefreshLayoutManager extends ViewGroupManager