Search in sources :

Example 1 with MessageDeserializer

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

the class MessageRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
    JSONArray data = result[0];
    JSONArray profiles = result[1];
    JSONArray urls = result[2];
    assocData(data, profiles, "author_id", "id", "author_name", "name");
    assocData(data, urls, "author_id", "id", "author_pic", "url");
    MessageDeserializer deserializer = new MessageDeserializer();
    ArrayList<GraphObject> messages = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
    Collections.reverse(messages);
    setHasMoreData(messages.size() >= 20);
    return messages;
}
Also used : MessageDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.MessageDeserializer) JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Aggregations

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