Browse Source

Revert "Delay onDisplay until react finishes layout cycle"

This reverts commit 90b47f7910.
Guy Carmeli 6 years ago
parent
commit
098d5f37b9

+ 7
- 12
android/app/src/main/java/com/reactnativenavigation/views/ContentView.java View File

@@ -81,21 +81,16 @@ public class ContentView extends ReactRootView {
81 81
         detectContentViewVisible(child);
82 82
     }
83 83
 
84
-    private void detectContentViewVisible(final View child) {
84
+    private void detectContentViewVisible(View child) {
85 85
         if (onDisplayListener != null) {
86
-            post(new Runnable() {
86
+            ViewUtils.runOnPreDraw(child, new Runnable() {
87 87
                 @Override
88 88
                 public void run() {
89
-                    ViewUtils.runOnPreDraw(child, new Runnable() {
90
-                        @Override
91
-                        public void run() {
92
-                            if (!isContentVisible) {
93
-                                isContentVisible = true;
94
-                                onDisplayListener.onDisplay();
95
-                                onDisplayListener = null;
96
-                            }
97
-                        }
98
-                    });
89
+                    if (!isContentVisible) {
90
+                        isContentVisible = true;
91
+                        onDisplayListener.onDisplay();
92
+                        onDisplayListener = null;
93
+                    }
99 94
                 }
100 95
             });
101 96
         }