Browse Source

Fixed some issues with pushing in tabs

Yedidya Kennard 8 years ago
parent
commit
d65a0d4073

+ 8
- 5
android/app/src/main/java/com/reactnativenavigation/activities/BottomTabActivity.java View File

@@ -103,11 +103,14 @@ public class BottomTabActivity extends BaseReactActivity implements AHBottomNavi
103 103
     @Override
104 104
     public Screen pop(String navigatorId) {
105 105
         super.pop(navigatorId);
106
-        Screen screen = mScreenStacks.get(mCurrentStackPosition).pop();
107
-        Screen currentScreen = getCurrentScreen();
108
-        setNavigationStyle(currentScreen);
109
-        mToolbar.update(currentScreen);
110
-        return screen;
106
+        for (ScreenStack stack: mScreenStacks) {
107
+            if (stack.peek().navigatorId.equals(navigatorId)) {
108
+                Screen popped = stack.pop();
109
+                setNavigationStyle(getCurrentScreen());
110
+                return popped;
111
+            }
112
+        }
113
+        return null;
111 114
     }
112 115
 
113 116
     @Override

+ 3
- 4
android/app/src/main/java/com/reactnativenavigation/modal/RnnModal.java View File

@@ -67,13 +67,12 @@ public class RnnModal extends Dialog implements DialogInterface.OnDismissListene
67 67
     }
68 68
 
69 69
     public Screen pop() {
70
+        Screen popped = mScreenStack.pop();
70 71
         if (mScreenStack.isEmpty()) {
71 72
             ModalController.getInstance().remove();
72
-            super.onBackPressed();
73
-            return null;
74
-        } else {
75
-            return mScreenStack.pop();
73
+            dismiss();
76 74
         }
75
+        return popped;
77 76
     }
78 77
 
79 78
     @Override

+ 7
- 6
android/app/src/main/java/com/reactnativenavigation/modules/RctActivityModule.java View File

@@ -144,14 +144,15 @@ public class RctActivityModule extends ReactContextBaseJavaModule {
144 144
                 });
145 145
             }
146 146
             return;
147
+        } else {
148
+            context.runOnUiThread(new Runnable() {
149
+                @Override
150
+                public void run() {
151
+                    context.pop(navigatorId);
152
+                }
153
+            });
147 154
         }
148 155
 
149
-        context.runOnUiThread(new Runnable() {
150
-            @Override
151
-            public void run() {
152
-                context.pop(navigatorId);
153
-            }
154
-        });
155 156
     }
156 157
 
157 158
     @ReactMethod