Browse Source

Show in app notifications on modals (#866)

Guy Carmeli 7 years ago
parent
commit
1a685073ee

+ 9
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/Modal.java View File

16
 import com.reactnativenavigation.params.FabParams;
16
 import com.reactnativenavigation.params.FabParams;
17
 import com.reactnativenavigation.params.Orientation;
17
 import com.reactnativenavigation.params.Orientation;
18
 import com.reactnativenavigation.params.ScreenParams;
18
 import com.reactnativenavigation.params.ScreenParams;
19
+import com.reactnativenavigation.params.SlidingOverlayParams;
19
 import com.reactnativenavigation.params.TitleBarButtonParams;
20
 import com.reactnativenavigation.params.TitleBarButtonParams;
20
 import com.reactnativenavigation.params.TitleBarLeftButtonParams;
21
 import com.reactnativenavigation.params.TitleBarLeftButtonParams;
21
 
22
 
60
         layout.dismissContextualMenu(screenInstanceId);
61
         layout.dismissContextualMenu(screenInstanceId);
61
     }
62
     }
62
 
63
 
64
+    void showSlidingOverlay(SlidingOverlayParams params) {
65
+        layout.showSlidingOverlay(params);
66
+    }
67
+
68
+    void hideSlidingOverlay() {
69
+        layout.hideSlidingOverlay();
70
+    }
71
+
63
     @Override
72
     @Override
64
     public boolean onTitleBarBackButtonClick() {
73
     public boolean onTitleBarBackButtonClick() {
65
         if (!layout.onBackPressed()) {
74
         if (!layout.onBackPressed()) {

+ 9
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/ModalController.java View File

9
 import com.reactnativenavigation.params.ContextualMenuParams;
9
 import com.reactnativenavigation.params.ContextualMenuParams;
10
 import com.reactnativenavigation.params.FabParams;
10
 import com.reactnativenavigation.params.FabParams;
11
 import com.reactnativenavigation.params.ScreenParams;
11
 import com.reactnativenavigation.params.ScreenParams;
12
+import com.reactnativenavigation.params.SlidingOverlayParams;
12
 import com.reactnativenavigation.params.TitleBarButtonParams;
13
 import com.reactnativenavigation.params.TitleBarButtonParams;
13
 import com.reactnativenavigation.params.TitleBarLeftButtonParams;
14
 import com.reactnativenavigation.params.TitleBarLeftButtonParams;
14
 
15
 
150
     public void onSideMenuButtonClick() {
151
     public void onSideMenuButtonClick() {
151
         // Do nothing and let the layout handle the click
152
         // Do nothing and let the layout handle the click
152
     }
153
     }
154
+
155
+    void showSlidingOverlay(SlidingOverlayParams params) {
156
+        stack.peek().showSlidingOverlay(params);
157
+    }
158
+
159
+    void hideSlidingOverlay() {
160
+        stack.peek().hideSlidingOverlay();
161
+    }
153
 }
162
 }

+ 10
- 2
android/app/src/main/java/com/reactnativenavigation/controllers/NavigationActivity.java View File

313
     }
313
     }
314
 
314
 
315
     public void showSlidingOverlay(SlidingOverlayParams params) {
315
     public void showSlidingOverlay(SlidingOverlayParams params) {
316
-        layout.showSlidingOverlay(params);
316
+        if (modalController.isShowing()) {
317
+            modalController.showSlidingOverlay(params);
318
+        } else {
319
+            layout.showSlidingOverlay(params);
320
+        }
317
     }
321
     }
318
 
322
 
319
     public void hideSlidingOverlay() {
323
     public void hideSlidingOverlay() {
320
-        layout.hideSlidingOverlay();
324
+        if (modalController.isShowing()) {
325
+            modalController.hideSlidingOverlay();
326
+        } else {
327
+            layout.hideSlidingOverlay();
328
+        }
321
     }
329
     }
322
 
330
 
323
     public void showSnackbar(SnackbarParams params) {
331
     public void showSnackbar(SnackbarParams params) {