Search in sources :

Example 1 with PageDeserializer

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

the class ElementPageRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
    JSONArray data = result[0];
    JSONArray urls = result[1];
    assocData(data, urls, "page_id", "id", "pic", "url");
    PageDeserializer deserializer = new PageDeserializer();
    ArrayList<GraphObject> pages = (ArrayList<GraphObject>) deserializer.deserializeArray(data);
    setHasMoreData(pages.size() >= 25);
    return pages;
}
Also used : JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject) PageDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.PageDeserializer)

Example 2 with PageDeserializer

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

the class PageRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray result) {
    PageDeserializer deserializer = new PageDeserializer();
    ArrayList<GraphObject> page = (ArrayList<GraphObject>) deserializer.deserializeArray(result);
    setHasMoreData(false);
    return page;
}
Also used : ArrayList(java.util.ArrayList) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject) PageDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.PageDeserializer)

Example 3 with PageDeserializer

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

the class PageProfileRequest method handleResult.

@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
    JSONArray pageData = result[0];
    JSONArray urls = result[1];
    assocData(pageData, urls, "page_id", "id", "pic", "url");
    JSONObject page = pageData.optJSONObject(0);
    ArrayList<GraphObject> data = null;
    if (page != null) {
        PageDeserializer deserializer = new PageDeserializer();
        data = (ArrayList<GraphObject>) deserializer.deserializeArray(pageData);
    } else {
        data = new ArrayList<GraphObject>();
    }
    setHasMoreData(false);
    return data;
}
Also used : JSONObject(org.json.JSONObject) JSONArray(org.json.JSONArray) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject) PageDeserializer(com.abewy.android.apps.klyph.core.fql.serializer.PageDeserializer)

Aggregations

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