private void handleAddTab(TabProxy tab) { String tag = TiConvert.toString(tab.getProperty(TiC.PROPERTY_TAG)); if (tag == null) { String title = TiConvert.toString(tab.getProperty(TiC.PROPERTY_TITLE)); if (title == null) { String icon = TiConvert.toString(tab.getProperty(TiC.PROPERTY_ICON)); if (icon == null) { tag = tab.toString(); } else { tag = icon; } } else { tag = title; } tab.setProperty(TiC.PROPERTY_TAG, tag, false); // store in proxy } if (tabs.size() == 0) { initialActiveTab = tab; } tabs.add(tab); if (peekView() != null) { TiUITabGroup tg = (TiUITabGroup) peekView(); addTabToGroup(tg, tab); } }
public void handlePostOpen(Activity activity) { ((TiTabActivity) activity).setTabGroupProxy(this); this.weakActivity = new WeakReference<TiTabActivity>((TiTabActivity) activity); TiUITabGroup tg = (TiUITabGroup) view; if (tabs != null) { for (TabProxy tab : tabs) { addTabToGroup(tg, tab); } } tg.changeActiveTab(initialActiveTab); opened = true; fireEvent(TiC.EVENT_OPEN, null); }