use of org.aisen.android.ui.fragment.ATabsTabLayoutFragment in project AisenWeiBo by wangdan.
the class AisenUtils method setTabsText.
public static void setTabsText(Fragment fragment, int index, String text) {
if (fragment.getActivity() == null)
return;
ABaseFragment aFragment = null;
if (fragment.getActivity() instanceof SinaCommonActivity) {
aFragment = (ABaseFragment) fragment.getActivity().getFragmentManager().findFragmentByTag(SinaCommonActivity.FRAGMENT_TAG);
} else if (fragment.getActivity() instanceof MainActivity) {
aFragment = (ABaseFragment) fragment.getActivity().getFragmentManager().findFragmentByTag("MainFragment");
}
if (aFragment != null && aFragment instanceof ATabsTabLayoutFragment) {
ATabsTabLayoutFragment tabsFragment = (ATabsTabLayoutFragment) aFragment;
tabsFragment.getTablayout().getTabAt(index).setText(text);
}
}
use of org.aisen.android.ui.fragment.ATabsTabLayoutFragment in project AisenWeiBo by wangdan.
the class MainActivity method onMenuSameClicked.
@Override
public boolean onMenuSameClicked(MenuFragment.NavMenuItem item) {
invalidateOptionsMenu();
// 重复点击了通知
if (item.id == MenuFragment.MENU_NOTIFICATION) {
Fragment fragment = getFragmentManager().findFragmentByTag("MainFragment");
if (fragment instanceof ATabsTabLayoutFragment && newIntentNotificationIndex != -1) {
ATabsTabLayoutFragment tabsTabLayoutFragment = (ATabsTabLayoutFragment) fragment;
tabsTabLayoutFragment.getViewPager().setCurrentItem(newIntentNotificationIndex);
((APagingFragment) tabsTabLayoutFragment.getCurrentFragment()).requestDataDelaySetRefreshing(AppSettings.REQUEST_DATA_DELAY);
newIntentNotificationIndex = -1;
}
}
closeDrawer();
return true;
}
Aggregations