use of org.qii.weiciyuan.bean.UnreadBean in project weiciyuan by qii.
the class AppNotificationCenter method showAndroidNotification.
public void showAndroidNotification(AccountBean account) {
UnreadBean unreadBean = unreadBeans.get(account);
MessageListBean mentions = unreadMentions.get(account);
CommentListBean comments = unreadComments.get(account);
CommentListBean mentionsComment = unreadMentionsComment.get(account);
String accountId = account.getUid();
if (mentions == null) {
mentions = new MessageListBean();
}
addDatabaseUnreadMentionsWeibo(accountId, mentions);
Utility.removeDuplicateAndSortStatus(mentions.getItemList());
if (comments == null) {
comments = new CommentListBean();
}
addDatabaseUnreadCommentsToMe(accountId, comments);
Utility.removeDuplicateAndSortComment(comments.getItemList());
if (mentionsComment == null) {
mentionsComment = new CommentListBean();
}
addDatabaseUnreadMentionsComment(accountId, mentionsComment);
Utility.removeDuplicateAndSortComment(mentionsComment.getItemList());
showNotification(GlobalContext.getInstance(), account, mentions, comments, mentionsComment, unreadBean);
}
use of org.qii.weiciyuan.bean.UnreadBean in project weiciyuan by qii.
the class ClearUnreadDao method clearCommentUnread.
public boolean clearCommentUnread(UnreadBean unreadBean, String accountId) throws WeiboException {
int count = unreadBean.getCmt();
UnreadBean currentCount = new UnreadDao(access_token, accountId).getCount();
if (currentCount == null) {
return false;
}
//already reset or have new unread message
if (count != currentCount.getCmt()) {
return false;
}
return new ClearUnreadDao(access_token, ClearUnreadDao.CMT).clearUnread();
}
use of org.qii.weiciyuan.bean.UnreadBean in project weiciyuan by qii.
the class ClearUnreadDao method clearMentionCommentUnread.
public boolean clearMentionCommentUnread(UnreadBean unreadBean, String accountId) throws WeiboException {
int count = unreadBean.getMention_cmt();
UnreadBean currentCount = new UnreadDao(access_token, accountId).getCount();
if (currentCount == null) {
return false;
}
//already reset or have new unread message
if (count != currentCount.getMention_cmt()) {
return false;
}
return new ClearUnreadDao(access_token, ClearUnreadDao.MENTION_CMT).clearUnread();
}
use of org.qii.weiciyuan.bean.UnreadBean in project weiciyuan by qii.
the class UnreadDao method getCount.
public UnreadBean getCount() throws WeiboException {
String json = getMsgListJson();
Gson gson = new Gson();
UnreadBean value = null;
try {
value = gson.fromJson(json, UnreadBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
return null;
}
return value;
}
Aggregations