Skip to content

Commit

Permalink
events
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Jan 2, 2025
1 parent 92c117a commit 3a52011
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3a52011

Please sign in to comment.