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;
}
}
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;
}
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;
}
}
Aggregations