소스 검색

Fix resetTo in SingleScreenApp

fixes #226
Guy Carmeli 8 년 전
부모
커밋
7595f9773f
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8
    2
      android/app/src/main/java/com/reactnativenavigation/layouts/SingleScreenLayout.java

+ 8
- 2
android/app/src/main/java/com/reactnativenavigation/layouts/SingleScreenLayout.java 파일 보기

@@ -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