use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class FollowedPeopleRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
JSONArray data = result[0];
JSONArray urls = result[1];
assocData(data, urls, "uid", "id", "pic", "url");
FriendDeserializer deserializer = new FriendDeserializer();
ArrayList<GraphObject> friends = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
setHasMoreData(friends.size() >= 50);
return friends;
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class EventRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
JSONArray eventData = result[0];
JSONArray rsvp_status = result[1];
ArrayList<GraphObject> data = new ArrayList<GraphObject>();
EventDeserializer deserializer = new EventDeserializer();
Event event = (Event) deserializer.deserializeArray(eventData).get(0);
try {
JSONObject o = rsvp_status.getJSONObject(0);
event.setUserResponse(o.getString("rsvp_status"));
} catch (JSONException e) {
event.setUserResponse(EventResponse.NOT_REPLIED.toString());
}
data.add(event);
setHasMoreData(false);
return data;
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class FriendListsRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray result) {
FriendListDeserializer deserializer = new FriendListDeserializer();
ArrayList<GraphObject> friendLists = (ArrayList<GraphObject>) deserializer.deserializeArray(result);
setHasMoreData(false);
return friendLists;
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class FriendsRequestNotificationRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
JSONArray data = result[0];
JSONArray urls = result[1];
JSONArray names = result[2];
for (int i = 0; i < urls.length(); i++) {
JSONObject jsonObject = urls.optJSONObject(i);
try {
jsonObject.putOpt("id", String.valueOf(jsonObject.opt("id")));
} catch (JSONException e) {
// e.printStackTrace();
}
}
for (int i = 0; i < names.length(); i++) {
JSONObject jsonObject = names.optJSONObject(i);
try {
jsonObject.putOpt("id", String.valueOf(jsonObject.opt("id")));
} catch (JSONException e) {
// e.printStackTrace();
}
}
assocData(data, urls, "uid_from", "id", "uid_from_pic", "url");
assocData(data, names, "uid_from", "id", "uid_from_name", "name");
FriendRequestDeserializer deserializer = new FriendRequestDeserializer();
ArrayList<GraphObject> friendRequests = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
return friendRequests;
}
use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.
the class GroupPhotosRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray result) {
PhotoDeserializer deserializer = new PhotoDeserializer();
ArrayList<GraphObject> photos = (ArrayList<GraphObject>) deserializer.deserializeArray(result);
setHasMoreData(photos.size() >= 50);
return photos;
}
Aggregations