Search in sources :

Example 1 with ATabsTabLayoutFragment

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);
    }
}
Also used : ABaseFragment(org.aisen.android.ui.fragment.ABaseFragment) ATabsTabLayoutFragment(org.aisen.android.ui.fragment.ATabsTabLayoutFragment) MainActivity(org.aisen.weibo.sina.ui.activity.base.MainActivity) SinaCommonActivity(org.aisen.weibo.sina.ui.activity.base.SinaCommonActivity)

Example 2 with ATabsTabLayoutFragment

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;
}
Also used : ATabsTabLayoutFragment(org.aisen.android.ui.fragment.ATabsTabLayoutFragment) APagingFragment(org.aisen.android.ui.fragment.APagingFragment) NotificationPagerFragment(org.aisen.weibo.sina.ui.fragment.comment.NotificationPagerFragment) SearchFragment(org.aisen.weibo.sina.ui.fragment.search.SearchFragment) APagingFragment(org.aisen.android.ui.fragment.APagingFragment) CacheClearFragment(org.aisen.weibo.sina.ui.fragment.settings.CacheClearFragment) BizFragment(org.aisen.weibo.sina.ui.fragment.base.BizFragment) WallpaperFragment(org.aisen.weibo.sina.ui.fragment.secondgroups.WallpaperFragment) ATabsTabLayoutFragment(org.aisen.android.ui.fragment.ATabsTabLayoutFragment) JokesPagerFragment(org.aisen.weibo.sina.ui.fragment.secondgroups.JokesPagerFragment) OtherItemFragment(org.aisen.weibo.sina.ui.fragment.settings.OtherItemFragment) FabGroupsFragment(org.aisen.weibo.sina.ui.fragment.menu.FabGroupsFragment) WebLoginFragment(org.aisen.weibo.sina.ui.fragment.account.WebLoginFragment) FriendshipPagerFragment(org.aisen.weibo.sina.ui.fragment.friendship.FriendshipPagerFragment) NotificationSettingsFragment(org.aisen.weibo.sina.ui.fragment.settings.NotificationSettingsFragment) CommentPagerFragment(org.aisen.weibo.sina.ui.fragment.comment.CommentPagerFragment) DraftFragment(org.aisen.weibo.sina.ui.fragment.draft.DraftFragment) ATabsFragment(org.aisen.android.ui.fragment.ATabsFragment) ABaseFragment(org.aisen.android.ui.fragment.ABaseFragment) SettingsPagerFragment(org.aisen.weibo.sina.ui.fragment.settings.SettingsPagerFragment) TimelineDefFragment(org.aisen.weibo.sina.ui.fragment.timeline.TimelineDefFragment) Fragment(android.app.Fragment) MentionPagerFragment(org.aisen.weibo.sina.ui.fragment.mention.MentionPagerFragment) MenuFragment(org.aisen.weibo.sina.ui.fragment.menu.MenuFragment) TimelineGroupsFragment(org.aisen.weibo.sina.ui.fragment.timeline.TimelineGroupsFragment)

Aggregations

ABaseFragment (org.aisen.android.ui.fragment.ABaseFragment)2 ATabsTabLayoutFragment (org.aisen.android.ui.fragment.ATabsTabLayoutFragment)2 Fragment (android.app.Fragment)1 APagingFragment (org.aisen.android.ui.fragment.APagingFragment)1 ATabsFragment (org.aisen.android.ui.fragment.ATabsFragment)1 MainActivity (org.aisen.weibo.sina.ui.activity.base.MainActivity)1 SinaCommonActivity (org.aisen.weibo.sina.ui.activity.base.SinaCommonActivity)1 WebLoginFragment (org.aisen.weibo.sina.ui.fragment.account.WebLoginFragment)1 BizFragment (org.aisen.weibo.sina.ui.fragment.base.BizFragment)1 CommentPagerFragment (org.aisen.weibo.sina.ui.fragment.comment.CommentPagerFragment)1 NotificationPagerFragment (org.aisen.weibo.sina.ui.fragment.comment.NotificationPagerFragment)1 DraftFragment (org.aisen.weibo.sina.ui.fragment.draft.DraftFragment)1 FriendshipPagerFragment (org.aisen.weibo.sina.ui.fragment.friendship.FriendshipPagerFragment)1 MentionPagerFragment (org.aisen.weibo.sina.ui.fragment.mention.MentionPagerFragment)1 FabGroupsFragment (org.aisen.weibo.sina.ui.fragment.menu.FabGroupsFragment)1 MenuFragment (org.aisen.weibo.sina.ui.fragment.menu.MenuFragment)1 SearchFragment (org.aisen.weibo.sina.ui.fragment.search.SearchFragment)1 JokesPagerFragment (org.aisen.weibo.sina.ui.fragment.secondgroups.JokesPagerFragment)1 WallpaperFragment (org.aisen.weibo.sina.ui.fragment.secondgroups.WallpaperFragment)1 CacheClearFragment (org.aisen.weibo.sina.ui.fragment.settings.CacheClearFragment)1