|
@@ -5,6 +5,8 @@ import android.support.v7.app.AppCompatActivity;
|
5
|
5
|
import com.reactnativenavigation.params.ScreenParams;
|
6
|
6
|
import com.reactnativenavigation.views.LeftButtonOnClickListener;
|
7
|
7
|
|
|
8
|
+import java.util.List;
|
|
9
|
+
|
8
|
10
|
public class ModalScreenLayout extends SingleScreenLayout {
|
9
|
11
|
|
10
|
12
|
public ModalScreenLayout(AppCompatActivity activity,
|
|
@@ -16,6 +18,23 @@ public class ModalScreenLayout extends SingleScreenLayout {
|
16
|
18
|
|
17
|
19
|
@Override
|
18
|
20
|
protected void pushInitialScreen(LayoutParams lp) {
|
19
|
|
- stack.pushInitialModalScreenWithAnimation(screenParams, lp);
|
|
21
|
+ if (screenParams.screens.isEmpty()) {
|
|
22
|
+ stack.pushInitialModalScreenWithAnimation(screenParams, lp);
|
|
23
|
+ } else {
|
|
24
|
+ stack.pushInitialScreen(screenParams, lp);
|
|
25
|
+ }
|
|
26
|
+ }
|
|
27
|
+
|
|
28
|
+ @Override
|
|
29
|
+ protected void pushAdditionalScreens(LayoutParams lp) {
|
|
30
|
+ List<ScreenParams> screens = screenParams.screens;
|
|
31
|
+ for (int i = 0, screensSize = screens.size(); i < screensSize; i++) {
|
|
32
|
+ ScreenParams screen = screens.get(i);
|
|
33
|
+ if (i == screens.size() - 1) {
|
|
34
|
+ stack.pushInitialModalScreenWithAnimation(screen, lp);
|
|
35
|
+ } else {
|
|
36
|
+ stack.pushInitialScreen(screen, lp);
|
|
37
|
+ }
|
|
38
|
+ }
|
20
|
39
|
}
|
21
|
40
|
}
|