Search in sources :

Example 1 with ShareListBean

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

the class ShareShortUrlTimeLineDao method getGSONMsgList.

public ShareListBean getGSONMsgList() throws WeiboException {
    String json = getMsgListJson();
    Gson gson = new Gson();
    ShareListBean value = null;
    try {
        value = gson.fromJson(json, ShareListBean.class);
    } catch (JsonSyntaxException e) {
        AppLogger.e(e.getMessage());
    }
    if (value != null) {
        Iterator<MessageBean> iterator = value.getItemList().iterator();
        while (iterator.hasNext()) {
            MessageBean msg = iterator.next();
            if (msg.getUser() == null) {
                iterator.remove();
            } else {
                msg.getListViewSpannableString();
                TimeUtility.dealMills(msg);
            }
        }
    }
    return value;
}
Also used : MessageBean(org.qii.weiciyuan.bean.MessageBean) JsonSyntaxException(com.google.gson.JsonSyntaxException) ShareListBean(org.qii.weiciyuan.bean.ShareListBean) Gson(com.google.gson.Gson)

Example 2 with ShareListBean

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

the class BrowserShareMsgLoader method loadData.

public ShareListBean loadData() throws WeiboException {
    ShareShortUrlTimeLineDao dao = new ShareShortUrlTimeLineDao(token, url);
    dao.setMaxId(maxId);
    ShareListBean result = null;
    lock.lock();
    try {
        result = dao.getGSONMsgList();
    } finally {
        lock.unlock();
    }
    return result;
}
Also used : ShareListBean(org.qii.weiciyuan.bean.ShareListBean) ShareShortUrlTimeLineDao(org.qii.weiciyuan.dao.shorturl.ShareShortUrlTimeLineDao)

Aggregations

ShareListBean (org.qii.weiciyuan.bean.ShareListBean)2 Gson (com.google.gson.Gson)1 JsonSyntaxException (com.google.gson.JsonSyntaxException)1 MessageBean (org.qii.weiciyuan.bean.MessageBean)1 ShareShortUrlTimeLineDao (org.qii.weiciyuan.dao.shorturl.ShareShortUrlTimeLineDao)1