Przeglądaj źródła

Add back button to last child in setStackRoot

This effectively reverts 96661e3308 and fixes the issue properly.
Guy Carmeli 5 lat temu
rodzic
commit
898cf7ae27

+ 2
- 1
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java Wyświetl plik

@@ -194,11 +194,12 @@ public class StackController extends ParentController<StackLayout> {
194 194
                 }
195 195
             });
196 196
         } else {
197
+            backButtonHelper.addToPushedChild(last(children));
197 198
             push(last(children), new CommandListenerAdapter() {
198 199
                 @Override
199 200
                 public void onSuccess(String childId) {
200 201
                     destroyStack(stackToDestroy);
201
-                    for (int i = 0; i < children.size(); i++) {
202
+                    for (int i = 0; i < children.size() - 1; i++) {
202 203
                         stack.set(children.get(i).getId(), children.get(i), i);
203 204
                         children.get(i).setParentController(StackController.this);
204 205
                         if (i == 0) {