Search in sources :

Example 1 with GroupListBean

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

the class FriendGroupDao method getGroup.

public GroupListBean getGroup() throws WeiboException {
    String url = URLHelper.FRIENDSGROUP_INFO;
    Map<String, String> map = new HashMap<String, String>();
    map.put("access_token", access_token);
    String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
    Gson gson = new Gson();
    GroupListBean value = null;
    try {
        value = gson.fromJson(jsonData, GroupListBean.class);
    } catch (JsonSyntaxException e) {
        AppLogger.e(e.getMessage());
    }
    return value;
}
Also used : JsonSyntaxException(com.google.gson.JsonSyntaxException) HashMap(java.util.HashMap) Gson(com.google.gson.Gson) GroupListBean(org.qii.weiciyuan.bean.GroupListBean)

Example 2 with GroupListBean

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

the class FriendsTimeLineDBTask method getOtherGroupData.

public static List<MessageTimeLineData> getOtherGroupData(String accountId, String exceptGroupId) {
    List<MessageTimeLineData> data = new ArrayList<MessageTimeLineData>();
    if (!"0".equals(exceptGroupId)) {
        TimeLinePosition position = getPosition(accountId);
        MessageListBean msgList = getHomeLineMsgList(accountId, position.position + AppConfig.DB_CACHE_COUNT_OFFSET);
        MessageTimeLineData home = new MessageTimeLineData("0", msgList, position);
        data.add(home);
    }
    MessageTimeLineData biGroup = HomeOtherGroupTimeLineDBTask.getTimeLineData(accountId, "1");
    data.add(biGroup);
    GroupListBean groupListBean = GroupDBTask.get(accountId);
    if (groupListBean != null) {
        List<GroupBean> lists = groupListBean.getLists();
        for (GroupBean groupBean : lists) {
            MessageTimeLineData dbMsg = HomeOtherGroupTimeLineDBTask.getTimeLineData(accountId, groupBean.getId());
            data.add(dbMsg);
        }
    }
    Iterator<MessageTimeLineData> iterator = data.iterator();
    while (iterator.hasNext()) {
        MessageTimeLineData single = iterator.next();
        if (single.groupId.equals(exceptGroupId)) {
            iterator.remove();
            break;
        }
    }
    return data;
}
Also used : MessageListBean(org.qii.weiciyuan.bean.MessageListBean) ArrayList(java.util.ArrayList) GroupListBean(org.qii.weiciyuan.bean.GroupListBean) GroupBean(org.qii.weiciyuan.bean.GroupBean) TimeLinePosition(org.qii.weiciyuan.bean.android.TimeLinePosition) MessageTimeLineData(org.qii.weiciyuan.bean.android.MessageTimeLineData)

Example 3 with GroupListBean

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

the class GroupDBTask method get.

public static GroupListBean get(String accountId) {
    String sql = "select * from " + GroupTable.TABLE_NAME + " where " + GroupTable.ACCOUNTID + "  = " + accountId;
    Cursor c = getRsd().rawQuery(sql, null);
    if (c.moveToNext()) {
        String json = c.getString(c.getColumnIndex(GroupTable.JSONDATA));
        if (!TextUtils.isEmpty(json)) {
            GroupListBean bean = new Gson().fromJson(json, GroupListBean.class);
            if (bean != null) {
                return bean;
            }
        }
    }
    return null;
}
Also used : GroupListBean(org.qii.weiciyuan.bean.GroupListBean) Gson(com.google.gson.Gson) Cursor(android.database.Cursor)

Example 4 with GroupListBean

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

the class ManageGroupDialog method onResume.

/**
     * alertdialog use string arry to store data, so you cant add or delete data
     */
@Override
public void onResume() {
    super.onResume();
    GroupListBean current = GlobalContext.getInstance().getGroup();
    if (current != this.group) {
        dismissAllowingStateLoss();
        ManageGroupDialog dialog = new ManageGroupDialog(current, uid);
        dialog.show(getFragmentManager(), "");
    }
}
Also used : GroupListBean(org.qii.weiciyuan.bean.GroupListBean)

Aggregations

GroupListBean (org.qii.weiciyuan.bean.GroupListBean)4 Gson (com.google.gson.Gson)2 Cursor (android.database.Cursor)1 JsonSyntaxException (com.google.gson.JsonSyntaxException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 GroupBean (org.qii.weiciyuan.bean.GroupBean)1 MessageListBean (org.qii.weiciyuan.bean.MessageListBean)1 MessageTimeLineData (org.qii.weiciyuan.bean.android.MessageTimeLineData)1 TimeLinePosition (org.qii.weiciyuan.bean.android.TimeLinePosition)1