public boolean removeAll() { tabs.clear(); itemBar.removeAllViews(); adapter.removeAll(); if (selector != null) { selector.removeAll(); } onGlobalLayout(); return true; }
public void setCurrentTab(int index) { Pair<View, View> tab = tabs.get(index); clearItemState(); // END // FIXME denan.wang; 2015/2/25; // tab.first.callOnClick(); // tab.first.performClick(); onSelectorClickListener.onClick(tab.first); // END if (selector != null) { selector.moveTo(index, isSelectorSmoothScroll); } }
public boolean removeTab(int index) { if (index < 0 || index >= tabs.size()) { return false; } Pair<View, View> tab = tabs.remove(index); if (tab != null) { itemBar.removeView(tab.first); adapter.remove(adapter.getIndexOfItem(tab.second)); if (selector != null) { selector.remove(index); } onGlobalLayout(); return true; } return false; }