Search in sources :

Example 1 with GroupDeserializer

use of com.abewy.android.apps.klyph.core.fql.serializer.GroupDeserializer in project Klyph by jonathangerbaud.

the class GroupsRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
    JSONArray group_member = result[0];
    JSONArray groups_data = result[1];
    assocData(groups_data, group_member, "gid", "gid", "unread", "unread");
    assocData(groups_data, group_member, "gid", "gid", "administrator", "administrator");
    assocData(groups_data, group_member, "gid", "gid", "positions", "positions");
    GroupDeserializer deserializer = new GroupDeserializer();
    ArrayList<GraphObject> groups = (ArrayList<GraphObject>) deserializer.deserializeArray(groups_data);
    setHasMoreData(groups.size() >= 50);
    return groups;
}
Also used : JSONArray(org.json.JSONArray) GroupDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.GroupDeserializer) ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 2 with GroupDeserializer

use of com.abewy.android.apps.klyph.core.fql.serializer.GroupDeserializer in project Klyph by jonathangerbaud.

the class GroupProfileRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
    JSONArray groupData = result[0];
    JSONObject page = groupData.optJSONObject(0);
    ArrayList<GraphObject> data = null;
    if (page != null) {
        GroupDeserializer deserializer = new GroupDeserializer();
        data = (ArrayList<GraphObject>) deserializer.deserializeArray(groupData);
    } else {
        data = new ArrayList<GraphObject>();
    }
    setHasMoreData(false);
    return data;
}
Also used : JSONObject(org.json.JSONObject) JSONArray(org.json.JSONArray) GroupDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.GroupDeserializer) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Aggregations

GroupDeserializer (com.abewy.android.apps.klyph.core.fql.serializer.GroupDeserializer)2 GraphObject (com.abewy.android.apps.klyph.core.graph.GraphObject)2 JSONArray (org.json.JSONArray)2 ArrayList (java.util.ArrayList)1 JSONObject (org.json.JSONObject)1