use of com.abewy.android.apps.klyph.core.fql.serializer.EventDeserializer 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.fql.serializer.EventDeserializer in project Klyph by jonathangerbaud.
the class ElementEventRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
JSONArray data = result[0];
JSONArray urls = result[1];
assocData(data, urls, "eid", "id", "pic", "url");
EventDeserializer deserializer = new EventDeserializer();
ArrayList<GraphObject> events = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
setHasMoreData(events.size() >= 25);
return events;
}
use of com.abewy.android.apps.klyph.core.fql.serializer.EventDeserializer in project Klyph by jonathangerbaud.
the class EventTimelineRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
ArrayList<GraphObject> streams = super.handleResult(result);
if (result.length > 12) {
if (result[12].length() > 0) {
JSONArray eventData = result[12];
JSONArray rsvp_status = result[13];
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());
}
streams.add(0, event);
}
}
setHasMoreData(streams.size() > 0);
return streams;
}
Aggregations