Search in sources :

Example 16 with CommentListBean

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

the class CommentsByIdTimeLineFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    bean = new CommentListBean();
    setHasOptionsMenu(true);
    setRetainInstance(false);
}
Also used : CommentListBean(org.qii.weiciyuan.bean.CommentListBean)

Example 17 with CommentListBean

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

the class CommentsByIdMsgLoader method loadData.

public CommentListBean loadData() throws WeiboException {
    CommentsTimeLineByIdDao dao = new CommentsTimeLineByIdDao(token, id);
    dao.setSince_id(sinceId);
    dao.setMax_id(maxId);
    CommentListBean result = null;
    lock.lock();
    try {
        result = dao.getGSONMsgList();
    } finally {
        lock.unlock();
    }
    return result;
}
Also used : CommentsTimeLineByIdDao(org.qii.weiciyuan.dao.timeline.CommentsTimeLineByIdDao) CommentListBean(org.qii.weiciyuan.bean.CommentListBean)

Example 18 with CommentListBean

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

the class CommentsByMeMsgLoader method loadData.

public CommentListBean loadData() throws WeiboException {
    CommentsTimeLineByMeDao dao = new CommentsTimeLineByMeDao(token);
    dao.setSince_id(sinceId);
    dao.setMax_id(maxId);
    CommentListBean result = null;
    lock.lock();
    try {
        result = dao.getGSONMsgList();
    } finally {
        lock.unlock();
    }
    return result;
}
Also used : CommentListBean(org.qii.weiciyuan.bean.CommentListBean) CommentsTimeLineByMeDao(org.qii.weiciyuan.dao.maintimeline.CommentsTimeLineByMeDao)

Example 19 with CommentListBean

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

the class MentionsCommentMsgLoader method loadData.

public CommentListBean loadData() throws WeiboException {
    MentionsCommentTimeLineDao dao = new MentionsCommentTimeLineDao(token);
    dao.setSince_id(sinceId);
    dao.setMax_id(maxId);
    CommentListBean result = null;
    lock.lock();
    try {
        result = dao.getGSONMsgList();
    } finally {
        lock.unlock();
    }
    return result;
}
Also used : MentionsCommentTimeLineDao(org.qii.weiciyuan.dao.maintimeline.MentionsCommentTimeLineDao) CommentListBean(org.qii.weiciyuan.bean.CommentListBean)

Example 20 with CommentListBean

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

the class CommentsTimeLineByMeDao method getGSONMsgList.

public CommentListBean getGSONMsgList() throws WeiboException {
    String url = URLHelper.COMMENTS_BY_ME_TIMELINE;
    Map<String, String> map = new HashMap<String, String>();
    map.put("access_token", access_token);
    map.put("since_id", since_id);
    map.put("max_id", max_id);
    map.put("count", count);
    map.put("page", page);
    map.put("filter_by_source", filter_by_source);
    String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
    Gson gson = new Gson();
    CommentListBean value = null;
    try {
        value = gson.fromJson(jsonData, CommentListBean.class);
    } catch (JsonSyntaxException e) {
        AppLogger.e(e.getMessage());
    }
    if (value != null && value.getSize() > 0) {
        List<CommentBean> msgList = value.getItemList();
        Iterator<CommentBean> iterator = msgList.iterator();
        while (iterator.hasNext()) {
            CommentBean msg = iterator.next();
            if (msg.getUser() == null) {
                iterator.remove();
            } else {
                msg.getListViewSpannableString();
                TimeUtility.dealMills(msg);
            }
        }
    }
    return value;
}
Also used : JsonSyntaxException(com.google.gson.JsonSyntaxException) HashMap(java.util.HashMap) Gson(com.google.gson.Gson) CommentListBean(org.qii.weiciyuan.bean.CommentListBean) CommentBean(org.qii.weiciyuan.bean.CommentBean)

Aggregations

CommentListBean (org.qii.weiciyuan.bean.CommentListBean)22 CommentBean (org.qii.weiciyuan.bean.CommentBean)7 CommentTimeLineData (org.qii.weiciyuan.bean.android.CommentTimeLineData)7 Gson (com.google.gson.Gson)6 JsonSyntaxException (com.google.gson.JsonSyntaxException)6 MessageListBean (org.qii.weiciyuan.bean.MessageListBean)5 ArrayList (java.util.ArrayList)4 UnreadBean (org.qii.weiciyuan.bean.UnreadBean)4 Cursor (android.database.Cursor)3 HashMap (java.util.HashMap)3 TimeLinePosition (org.qii.weiciyuan.bean.android.TimeLinePosition)3 AccountBean (org.qii.weiciyuan.bean.AccountBean)2 MainCommentsTimeLineDao (org.qii.weiciyuan.dao.maintimeline.MainCommentsTimeLineDao)2 MentionsCommentTimeLineDao (org.qii.weiciyuan.dao.maintimeline.MentionsCommentTimeLineDao)2 Notification (android.app.Notification)1 NotificationManager (android.app.NotificationManager)1 PendingIntent (android.app.PendingIntent)1 Context (android.content.Context)1 Intent (android.content.Intent)1 IntentFilter (android.content.IntentFilter)1