Search in sources :

Example 1 with UnreadTabIndex

use of org.qii.weiciyuan.bean.android.UnreadTabIndex in project weiciyuan by qii.

the class MentionsTimeLine method onResume.

@Override
public void onResume() {
    super.onResume();
    Intent intent = getActivity().getIntent();
    if (intent == null) {
        return;
    }
    UnreadTabIndex unreadTabIndex = (UnreadTabIndex) intent.getSerializableExtra(BundleArgsConstants.OPEN_NAVIGATION_INDEX_EXTRA);
    if (unreadTabIndex == null) {
        return;
    }
    switch(unreadTabIndex) {
        case MENTION_WEIBO:
            ((MainTimeLineActivity) getActivity()).getMenuFragment().switchCategory(LeftMenuFragment.MENTIONS_INDEX);
            viewPager.setCurrentItem(0);
            intent.putExtra(BundleArgsConstants.OPEN_NAVIGATION_INDEX_EXTRA, UnreadTabIndex.NONE);
            break;
        case MENTION_COMMENT:
            ((MainTimeLineActivity) getActivity()).getMenuFragment().switchCategory(LeftMenuFragment.MENTIONS_INDEX);
            viewPager.setCurrentItem(1);
            intent.putExtra(BundleArgsConstants.OPEN_NAVIGATION_INDEX_EXTRA, UnreadTabIndex.NONE);
            break;
    }
}
Also used : UnreadTabIndex(org.qii.weiciyuan.bean.android.UnreadTabIndex) Intent(android.content.Intent)

Example 2 with UnreadTabIndex

use of org.qii.weiciyuan.bean.android.UnreadTabIndex in project weiciyuan by qii.

the class BigTextNotificationService method getPendingIntent.

private PendingIntent getPendingIntent(Intent clickToOpenAppPendingIntentInner, Parcelable itemBean, AccountBean accountBean) {
    clickToOpenAppPendingIntentInner.setExtrasClassLoader(getClass().getClassLoader());
    UnreadTabIndex unreadTabIndex = UnreadTabIndex.NONE;
    if (itemBean instanceof MessageBean) {
        unreadTabIndex = UnreadTabIndex.MENTION_WEIBO;
    } else if (itemBean instanceof CommentBean) {
        CommentBean commentBean = (CommentBean) itemBean;
        MessageBean messageBean = commentBean.getStatus();
        if (messageBean != null) {
            UserBean userBean = messageBean.getUser();
            if (accountBean.getInfo().equals(userBean)) {
                unreadTabIndex = UnreadTabIndex.COMMENT_TO_ME;
            } else {
                unreadTabIndex = UnreadTabIndex.MENTION_COMMENT;
            }
        } else {
            unreadTabIndex = UnreadTabIndex.MENTION_COMMENT;
        }
    }
    clickToOpenAppPendingIntentInner.putExtra(BundleArgsConstants.OPEN_NAVIGATION_INDEX_EXTRA, unreadTabIndex);
    PendingIntent pendingIntent = PendingIntent.getActivity(getBaseContext(), getMentionsWeiboNotificationId(accountBean), clickToOpenAppPendingIntentInner, PendingIntent.FLAG_UPDATE_CURRENT);
    return pendingIntent;
}
Also used : MessageBean(org.qii.weiciyuan.bean.MessageBean) UnreadTabIndex(org.qii.weiciyuan.bean.android.UnreadTabIndex) UserBean(org.qii.weiciyuan.bean.UserBean) PendingIntent(android.app.PendingIntent) CommentBean(org.qii.weiciyuan.bean.CommentBean)

Example 3 with UnreadTabIndex

use of org.qii.weiciyuan.bean.android.UnreadTabIndex in project weiciyuan by qii.

the class CommentsTimeLine method onResume.

@Override
public void onResume() {
    super.onResume();
    Intent intent = getActivity().getIntent();
    if (intent == null) {
        return;
    }
    UnreadTabIndex unreadTabIndex = (UnreadTabIndex) intent.getSerializableExtra(BundleArgsConstants.OPEN_NAVIGATION_INDEX_EXTRA);
    if (unreadTabIndex == null) {
        return;
    }
    switch(unreadTabIndex) {
        case COMMENT_TO_ME:
            ((MainTimeLineActivity) getActivity()).getMenuFragment().switchCategory(LeftMenuFragment.COMMENTS_INDEX);
            viewPager.setCurrentItem(0);
            intent.putExtra(BundleArgsConstants.OPEN_NAVIGATION_INDEX_EXTRA, UnreadTabIndex.NONE);
            break;
    }
}
Also used : UnreadTabIndex(org.qii.weiciyuan.bean.android.UnreadTabIndex) Intent(android.content.Intent)

Aggregations

UnreadTabIndex (org.qii.weiciyuan.bean.android.UnreadTabIndex)3 Intent (android.content.Intent)2 PendingIntent (android.app.PendingIntent)1 CommentBean (org.qii.weiciyuan.bean.CommentBean)1 MessageBean (org.qii.weiciyuan.bean.MessageBean)1 UserBean (org.qii.weiciyuan.bean.UserBean)1