Browse Source

Send missing visibility events to TopTab screens

Guy Carmeli 7 years ago
parent
commit
90df99030c

+ 4
- 4
android/app/src/main/java/com/reactnativenavigation/screens/ScreenStack.java View File

122
                                           @Nullable final Screen.OnDisplayListener onDisplay) {
122
                                           @Nullable final Screen.OnDisplayListener onDisplay) {
123
         nextScreen.setVisibility(View.INVISIBLE);
123
         nextScreen.setVisibility(View.INVISIBLE);
124
         addScreen(nextScreen, layoutParams);
124
         addScreen(nextScreen, layoutParams);
125
-        NavigationApplication.instance.getEventEmitter().sendWillDisappearEvent(previousScreen.screenParams, NavigationType.Push);
125
+        NavigationApplication.instance.getEventEmitter().sendWillDisappearEvent(previousScreen.getScreenParams(), NavigationType.Push);
126
         nextScreen.setOnDisplayListener(new Screen.OnDisplayListener() {
126
         nextScreen.setOnDisplayListener(new Screen.OnDisplayListener() {
127
             @Override
127
             @Override
128
             public void onDisplay() {
128
             public void onDisplay() {
130
                     @Override
130
                     @Override
131
                     public void run() {
131
                     public void run() {
132
                         if (onDisplay != null) onDisplay.onDisplay();
132
                         if (onDisplay != null) onDisplay.onDisplay();
133
-                        NavigationApplication.instance.getEventEmitter().sendDidDisappearEvent(previousScreen.screenParams, NavigationType.Push);
133
+                        NavigationApplication.instance.getEventEmitter().sendDidDisappearEvent(previousScreen.getScreenParams(), NavigationType.Push);
134
                         parent.removeView(previousScreen);
134
                         parent.removeView(previousScreen);
135
                     }
135
                     }
136
                 }, NavigationType.Push);
136
                 }, NavigationType.Push);
208
     }
208
     }
209
 
209
 
210
     private void hideScreen(boolean animated, final Screen toRemove, final Screen previous) {
210
     private void hideScreen(boolean animated, final Screen toRemove, final Screen previous) {
211
-        NavigationApplication.instance.getEventEmitter().sendWillAppearEvent(previous.screenParams, NavigationType.Pop);
211
+        NavigationApplication.instance.getEventEmitter().sendWillAppearEvent(previous.getScreenParams(), NavigationType.Pop);
212
         Runnable onAnimationEnd = new Runnable() {
212
         Runnable onAnimationEnd = new Runnable() {
213
             @Override
213
             @Override
214
             public void run() {
214
             public void run() {
215
                 toRemove.destroy();
215
                 toRemove.destroy();
216
                 parent.removeView(toRemove);
216
                 parent.removeView(toRemove);
217
-                NavigationApplication.instance.getEventEmitter().sendDidAppearEvent(previous.screenParams, NavigationType.Pop);
217
+                NavigationApplication.instance.getEventEmitter().sendDidAppearEvent(previous.getScreenParams(), NavigationType.Pop);
218
             }
218
             }
219
         };
219
         };
220
         if (animated) {
220
         if (animated) {