Search in sources :

Example 1 with UnifiedMessageDeserializer

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

the class ThreadMessagesRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
    JSONArray data = result[0];
    JSONArray recipients = result[1];
    JSONArray user_pics = result[2];
    assocData(recipients, user_pics, "id", "id", "pic", "url");
    assocData3(data, recipients, "recipients", "id", "recipients_friends");
    UnifiedMessageDeserializer deserializer = new UnifiedMessageDeserializer();
    ArrayList<GraphObject> mts = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
    Collections.reverse(mts);
    setHasMoreData(mts.size() >= 15);
    return mts;
}
Also used : JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) UnifiedMessageDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.UnifiedMessageDeserializer) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 2 with UnifiedMessageDeserializer

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

the class UserMessagesRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
    JSONArray data = result[0];
    JSONArray recipients = result[1];
    JSONArray user_pics = result[2];
    assocData(recipients, user_pics, "id", "id", "pic", "url");
    assocData3(data, recipients, "recipients", "id", "recipients_friends");
    UnifiedMessageDeserializer deserializer = new UnifiedMessageDeserializer();
    ArrayList<GraphObject> mts = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
    Collections.reverse(mts);
    setHasMoreData(mts.size() >= 15);
    return mts;
}
Also used : JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) UnifiedMessageDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.UnifiedMessageDeserializer) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Aggregations

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