Search in sources :

Example 1 with MessageReCmtCountBean

use of org.qii.weiciyuan.bean.MessageReCmtCountBean in project weiciyuan by qii.

the class FriendsTimeLineFragment method updateTimeLineMessageCommentAndRepostData.

private void updateTimeLineMessageCommentAndRepostData(List<MessageReCmtCountBean> value) {
    if (value == null) {
        return;
    }
    HashMap<String, MessageReCmtCountBean> messageReCmtCountBeanHashMap = new HashMap<String, MessageReCmtCountBean>();
    for (MessageReCmtCountBean count : value) {
        messageReCmtCountBeanHashMap.put(count.getId(), count);
    }
    for (int i = 0; i < getList().getSize(); i++) {
        MessageBean msg = getList().getItem(i);
        if (msg == null) {
            continue;
        }
        MessageReCmtCountBean count = messageReCmtCountBeanHashMap.get(msg.getId());
        if (count != null) {
            msg.setReposts_count(count.getReposts());
            msg.setComments_count(count.getComments());
        }
    }
    getAdapter().notifyDataSetChanged();
    FriendsTimeLineDBTask.asyncReplace(getList(), accountBean.getUid(), currentGroupId);
}
Also used : MessageBean(org.qii.weiciyuan.bean.MessageBean) HashMap(java.util.HashMap) MessageReCmtCountBean(org.qii.weiciyuan.bean.MessageReCmtCountBean)

Aggregations

HashMap (java.util.HashMap)1 MessageBean (org.qii.weiciyuan.bean.MessageBean)1 MessageReCmtCountBean (org.qii.weiciyuan.bean.MessageReCmtCountBean)1