use of org.qii.weiciyuan.bean.MessageListBean 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.MessageListBean in project weiciyuan by qii.
the class FriendsTimeLineDBTask method getRecentGroupData.
public static MessageTimeLineData getRecentGroupData(String accountId) {
String groupId = getRecentGroupId(accountId);
MessageListBean msgList;
TimeLinePosition position;
if (groupId.equals("0")) {
position = getPosition(accountId);
msgList = getHomeLineMsgList(accountId, position.position + AppConfig.DB_CACHE_COUNT_OFFSET);
} else {
position = HomeOtherGroupTimeLineDBTask.getPosition(accountId, groupId);
msgList = HomeOtherGroupTimeLineDBTask.get(accountId, groupId, position.position + AppConfig.DB_CACHE_COUNT_OFFSET);
}
return new MessageTimeLineData(groupId, msgList, position);
}
use of org.qii.weiciyuan.bean.MessageListBean in project weiciyuan by qii.
the class HomeOtherGroupTimeLineDBTask method getTimeLineData.
static MessageTimeLineData getTimeLineData(String accountId, String groupId) {
TimeLinePosition position = getPosition(accountId, groupId);
MessageListBean msgList = get(accountId, groupId, position.position + AppConfig.DB_CACHE_COUNT_OFFSET);
return new MessageTimeLineData(groupId, msgList, position);
}
use of org.qii.weiciyuan.bean.MessageListBean in project weiciyuan by qii.
the class MentionsWeiboTimeLineFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
userBean = getArguments().getParcelable(ARGUMENTS_USER_EXTRA);
accountBean = getArguments().getParcelable(ARGUMENTS_ACCOUNT_EXTRA);
token = getArguments().getString(ARGUMENTS_TOKEN_EXTRA);
super.onActivityCreated(savedInstanceState);
switch(getCurrentState(savedInstanceState)) {
case FIRST_TIME_START:
getLoaderManager().initLoader(DB_CACHE_LOADER_ID, null, dbCallback);
break;
case ACTIVITY_DESTROY_AND_CREATE:
timeLinePosition = (TimeLinePosition) savedInstanceState.getSerializable(ARGUMENTS_TIMELINE_POSITION_EXTRA);
Loader<MentionTimeLineData> loader = getLoaderManager().getLoader(DB_CACHE_LOADER_ID);
if (loader != null) {
getLoaderManager().initLoader(DB_CACHE_LOADER_ID, null, dbCallback);
}
MessageListBean savedBean = savedInstanceState.getParcelable(ARGUMENTS_DATA_EXTRA);
if (savedBean != null && savedBean.getSize() > 0) {
getList().replaceData(savedBean);
timeLineAdapter.notifyDataSetChanged();
refreshLayout(getList());
AppNotificationCenter.getInstance().addCallback(callback);
} else {
getLoaderManager().initLoader(DB_CACHE_LOADER_ID, null, dbCallback);
}
break;
}
}
use of org.qii.weiciyuan.bean.MessageListBean in project weiciyuan by qii.
the class FriendsTimeLineFragment method putToGroupDataMemoryCache.
private void putToGroupDataMemoryCache(String groupId, MessageListBean value) {
MessageListBean copy = new MessageListBean();
copy.addNewData(value);
groupDataCache.put(groupId, copy);
}
Aggregations