|
15 | 15 | import com.reactnativenavigation.options.BottomTabOptions; |
16 | 16 | import com.reactnativenavigation.options.Options; |
17 | 17 | import com.reactnativenavigation.react.CommandListener; |
18 | | -import com.reactnativenavigation.react.CommandListenerAdapter; |
19 | 18 | import com.reactnativenavigation.react.events.EventEmitter; |
20 | 19 | import com.reactnativenavigation.utils.ImageLoader; |
21 | 20 | import com.reactnativenavigation.viewcontrollers.bottomtabs.attacher.BottomTabsAttacher; |
22 | 21 | import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry; |
23 | 22 | import com.reactnativenavigation.viewcontrollers.parent.ParentController; |
24 | | -import com.reactnativenavigation.viewcontrollers.stack.StackController; |
25 | 23 | import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter; |
26 | 24 | import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController; |
27 | 25 | import com.reactnativenavigation.views.bottomtabs.BottomTabs; |
@@ -171,22 +169,15 @@ public ViewController<?> getCurrentChild() { |
171 | 169 |
|
172 | 170 | @Override |
173 | 171 | public boolean onTabSelected(int index, boolean wasSelected) { |
174 | | - ViewController<?> stack = tabs.get(index); |
175 | | - BottomTabOptions options = stack.resolveCurrentOptions().bottomTabOptions; |
| 172 | + BottomTabOptions options = tabs.get(index).resolveCurrentOptions().bottomTabOptions; |
176 | 173 |
|
177 | 174 | eventEmitter.emitBottomTabPressed(index); |
178 | 175 |
|
179 | 176 | if (options.selectTabOnPress.get(true)) { |
180 | 177 | eventEmitter.emitBottomTabSelected(bottomTabs.getCurrentItem(), index); |
181 | | - if (!wasSelected) { |
182 | | - selectTab(index); |
183 | | - } |
| 178 | + if (wasSelected) return false; |
| 179 | + selectTab(index); |
184 | 180 | } |
185 | | - |
186 | | - if (wasSelected && stack instanceof StackController) { |
187 | | - ((StackController) stack).popToRoot(Options.EMPTY, new CommandListenerAdapter()); |
188 | | - } |
189 | | - |
190 | 181 | return false; |
191 | 182 | } |
192 | 183 |
|
|
0 commit comments