use of org.qii.weiciyuan.bean.GroupBean in project weiciyuan by qii.
the class GroupListDao method getInfo.
public List<String> getInfo() throws WeiboException {
String url = URLHelper.GROUP_MEMBER_LIST;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("uids", uids);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
Gson gson = new Gson();
List<GroupUser> value = null;
try {
value = gson.fromJson(jsonData, new TypeToken<List<GroupUser>>() {
}.getType());
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
if (value != null && value.size() > 0) {
GroupUser user = value.get(0);
List<String> ids = new ArrayList<String>();
for (GroupBean b : user.lists) {
ids.add(b.getIdstr());
}
return ids;
}
return null;
}
use of org.qii.weiciyuan.bean.GroupBean in project weiciyuan by qii.
the class UpdateGroupNameDao method update.
public GroupBean update() throws WeiboException {
String url = URLHelper.GROUP_UPDATE;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("name", name);
map.put("list_id", list_id);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Post, url, map);
Gson gson = new Gson();
GroupBean value = null;
try {
value = gson.fromJson(jsonData, GroupBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
return value;
}
use of org.qii.weiciyuan.bean.GroupBean 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;
}
use of org.qii.weiciyuan.bean.GroupBean in project weiciyuan by qii.
the class ManageGroupDialog method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
if (savedInstanceState != null) {
group = (GroupListBean) savedInstanceState.getParcelable("group");
uid = savedInstanceState.getString("uid");
valueArray = savedInstanceState.getStringArray("valueArray");
selectedArray = savedInstanceState.getBooleanArray("selectedArray");
currentList = savedInstanceState.getStringArrayList("currentList");
addList = savedInstanceState.getStringArrayList("addList");
removeList = savedInstanceState.getStringArrayList("removeList");
}
final List<GroupBean> list = group.getLists();
selectedArray = new boolean[list.size()];
List<String> name = new ArrayList<String>();
for (int i = 0; i < list.size(); i++) {
name.add(list.get(i).getName());
}
valueArray = name.toArray(new String[0]);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View customTitle = getActivity().getLayoutInflater().inflate(R.layout.managegroupdialog_title_layout, null);
ImageView setting = (ImageView) customTitle.findViewById(R.id.title_button);
setting.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getActivity(), ManageGroupActivity.class));
}
});
builder.setMultiChoiceItems(valueArray, selectedArray, new DialogMultiChoiceClickListener()).setPositiveButton(getString(R.string.save), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ModifyGroupMemberTask modifyGroupMemberTask = new ModifyGroupMemberTask(uid, addList, removeList);
modifyGroupMemberTask.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR);
}
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).setCustomTitle(customTitle);
task = new Task();
task.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR);
return builder.create();
}
use of org.qii.weiciyuan.bean.GroupBean in project weiciyuan by qii.
the class FriendsTimeLineFragment method buildListNavData.
private String[] buildListNavData(List<GroupBean> list) {
List<String> name = new ArrayList<String>();
name.add(getString(R.string.all_people));
name.add(getString(R.string.bilateral));
for (GroupBean b : list) {
name.add(b.getName());
}
String[] valueArray = name.toArray(new String[0]);
return valueArray;
}
Aggregations