|
@@ -344,7 +344,8 @@ public class BottomTabsLayout extends BaseLayout implements AHBottomNavigation.O
|
344
|
344
|
|
345
|
345
|
public void selectBottomTabByTabIndex(Integer index) {
|
346
|
346
|
if (bottomTabs.getCurrentItem() != index) {
|
347
|
|
- bottomTabs.setCurrentItem(index);
|
|
347
|
+ bottomTabs.setCurrentItemWithoutInvokingTabSelectedListener(index);
|
|
348
|
+ switchTab(index, NavigationType.SwitchToTab);
|
348
|
349
|
}
|
349
|
350
|
}
|
350
|
351
|
|
|
@@ -478,13 +479,17 @@ public class BottomTabsLayout extends BaseLayout implements AHBottomNavigation.O
|
478
|
479
|
}
|
479
|
480
|
|
480
|
481
|
final int unselectedTabIndex = currentStackIndex;
|
481
|
|
- hideCurrentStack();
|
482
|
|
- showNewStack(position, NavigationType.BottomTabSelected);
|
483
|
|
- EventBus.instance.post(new ScreenChangedEvent(getCurrentScreenStack().peek().getScreenParams()));
|
|
482
|
+ switchTab(position, NavigationType.BottomTabSelected);
|
484
|
483
|
sendTabSelectedEventToJs(position, unselectedTabIndex);
|
485
|
484
|
return true;
|
486
|
485
|
}
|
487
|
486
|
|
|
487
|
+ private void switchTab(int position, NavigationType navigationType) {
|
|
488
|
+ hideCurrentStack();
|
|
489
|
+ showNewStack(position, navigationType);
|
|
490
|
+ EventBus.instance.post(new ScreenChangedEvent(getCurrentScreenStack().peek().getScreenParams()));
|
|
491
|
+ }
|
|
492
|
+
|
488
|
493
|
private void sendTabSelectedEventToJs(int selectedTabIndex, int unselectedTabIndex) {
|
489
|
494
|
String navigatorEventId = getCurrentScreenStack().peek().getNavigatorEventId();
|
490
|
495
|
WritableMap data = createTabSelectedEventData(selectedTabIndex, unselectedTabIndex);
|