diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigation.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigation.java index 10d52338e2f..153a7cb7238 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigation.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigation.java @@ -243,7 +243,9 @@ public void removeTabItemFromController(int position) @Override public void selectTabItemInController(int position) { - + // select first tab and fire event + currentlySelectedIndex = position; + ((TabGroupProxy) getProxy()).onTabSelected(position); } private void updateDrawablesAfterNewItem(int index) @@ -503,10 +505,20 @@ public String getTabTitle(int index) public void selectTab(int tabIndex) { super.selectTab(tabIndex); - currentlySelectedIndex = tabIndex; if (tabsArray == null || tabsArray.isEmpty()) { return; } + + // unselected event + if ((currentlySelectedIndex >= 0) && (tabIndex != currentlySelectedIndex) + && (currentlySelectedIndex < this.tabs.size()) && (getProxy() != null)) { + TiViewProxy tabProxy = ((TabProxy) tabsArray.get(currentlySelectedIndex)); + if (tabProxy != null) { + tabProxy.fireEvent(TiC.EVENT_UNSELECTED, null, false); + } + } + currentlySelectedIndex = tabIndex; + TabProxy tp = ((TabProxy) tabsArray.get(tabIndex)); if (tp != null) { TiUITab abstractTab = new TiUITab(tp);