Browse Source

Fix resetTo in SingleScreenApp

fixes #226
Guy Carmeli 8 years ago
parent
commit
7595f9773f

+ 8
- 2
android/app/src/main/java/com/reactnativenavigation/layouts/SingleScreenLayout.java View File

@@ -137,8 +137,14 @@ public class SingleScreenLayout extends RelativeLayout implements Layout {
137 137
 
138 138
     @Override
139 139
     public void newStack(ScreenParams params) {
140
-        RelativeLayout parent = sideMenu == null ? this : sideMenu.getContentContainer();
141
-        createStack(parent);
140
+        removeView(stack.peek());
141
+        stack.destroy();
142
+
143
+        ScreenStack newStack = new ScreenStack(activity, getScreenStackParent(), params.getNavigatorId(), this);
144
+        LayoutParams lp = new LayoutParams(MATCH_PARENT, MATCH_PARENT);
145
+        newStack.pushInitialScreenWithAnimation(params, lp);
146
+        stack = newStack;
147
+
142 148
         EventBus.instance.post(new ScreenChangedEvent(params));
143 149
     }
144 150