public void update() { final ActionBar.Tab tab = mTab; final View custom = tab.getCustomView(); if (custom != null) { final ViewParent customParent = custom.getParent(); final Drawable icon = tab.getIcon(); final CharSequence text = tab.getText(); mIconView.setContentDescription(tab.getContentDescription());
@Override public void selectTab(Tab tab) { if (getNavigationMode() != NAVIGATION_MODE_TABS) { mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION; return; } FragmentTransaction trans = null; if (mActivity instanceof FragmentActivity) { trans = ((FragmentActivity)mActivity).getSupportFragmentManager().beginTransaction() .disallowAddToBackStack(); } if (mSelectedTab == tab) { if (mSelectedTab != null) { mSelectedTab.getCallback().onTabReselected(mSelectedTab, trans); mTabScrollView.animateToTab(tab.getPosition()); } } else { mTabScrollView.setTabSelected(tab != null ? tab.getPosition() : Tab.INVALID_POSITION); if (mSelectedTab != null) { mSelectedTab.getCallback().onTabUnselected(mSelectedTab, trans); } mSelectedTab = (TabImpl) tab; if (mSelectedTab != null) { mSelectedTab.getCallback().onTabSelected(mSelectedTab, trans); } } if (trans != null && !trans.isEmpty()) { trans.commit(); } }
public void onClick(View view) { TabView tabView = (TabView) view; tabView.getTab().select(); final int tabCount = mTabLayout.getChildCount(); for (int i = 0; i < tabCount; i++) { final View child = mTabLayout.getChildAt(i); child.setSelected(child == view); } } }
public void update() { final ActionBar.Tab tab = mTab; final View custom = tab.getCustomView(); if (custom != null) { final ViewParent customParent = custom.getParent(); final Drawable icon = tab.getIcon(); final CharSequence text = tab.getText(); mIconView.setContentDescription(tab.getContentDescription());
@Override public void selectTab(Tab tab) { if (getNavigationMode() != NAVIGATION_MODE_TABS) { mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION; return; } FragmentTransaction trans = null; if (mActivity instanceof SherlockFragmentActivity) { trans = ((SherlockFragmentActivity)mActivity).getSupportFragmentManager().beginTransaction() .disallowAddToBackStack(); } if (mSelectedTab == tab) { if (mSelectedTab != null) { mSelectedTab.getCallback().onTabReselected(mSelectedTab, trans); mTabScrollView.animateToTab(tab.getPosition()); } } else { mTabScrollView.setTabSelected(tab != null ? tab.getPosition() : Tab.INVALID_POSITION); if (mSelectedTab != null) { mSelectedTab.getCallback().onTabUnselected(mSelectedTab, trans); } mSelectedTab = (TabImpl) tab; if (mSelectedTab != null) { mSelectedTab.getCallback().onTabSelected(mSelectedTab, trans); } } if (trans != null && !trans.isEmpty()) { trans.commit(); } }
@Override public void onItemSelected(IcsAdapterView<?> parent, View view, int position, long id) { TabView tabView = (TabView) view; tabView.getTab().select(); }
public void onClick(View view) { TabView tabView = (TabView) view; tabView.getTab().select(); final int tabCount = mTabLayout.getChildCount(); for (int i = 0; i < tabCount; i++) { final View child = mTabLayout.getChildAt(i); child.setSelected(child == view); } } }
@Override public void removeTab(Tab tab) { removeTabAt(tab.getPosition()); }
@Override public void removeTab(Tab tab) { removeTabAt(tab.getPosition()); }
@Override public void onItemSelected(IcsAdapterView<?> parent, View view, int position, long id) { TabView tabView = (TabView) view; tabView.getTab().select(); }