Search in sources :

Example 16 with GraphObject

use of com.abewy.android.apps.klyph.core.graph.GraphObject 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 17 with GraphObject

use of com.abewy.android.apps.klyph.core.graph.GraphObject 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 18 with GraphObject

use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.

the class PhotoListRequest method handleResult.

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

Example 19 with GraphObject

use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.

the class AlbumVideosAllRequest method handleResult.

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

Example 20 with GraphObject

use of com.abewy.android.apps.klyph.core.graph.GraphObject in project Klyph by jonathangerbaud.

the class EventInvitedRequest method handleResult.

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

Aggregations

GraphObject (com.abewy.android.apps.klyph.core.graph.GraphObject)101 ArrayList (java.util.ArrayList)71 JSONArray (org.json.JSONArray)41 JSONObject (org.json.JSONObject)16 FriendDeserializer (com.abewy.android.apps.klyph.core.fql.serializer.FriendDeserializer)11 PhotoDeserializer (com.abewy.android.apps.klyph.core.fql.serializer.PhotoDeserializer)9 MultiObjectAdapter (com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)7 Stream (com.abewy.android.apps.klyph.core.fql.Stream)7 View (android.view.View)6 KlyphNotification (com.abewy.android.apps.klyph.KlyphNotification)6 Notification (com.abewy.android.apps.klyph.core.fql.Notification)6 Photo (com.abewy.android.apps.klyph.core.fql.Photo)6 JSONException (org.json.JSONException)6 StreamDeserializer (com.abewy.android.apps.klyph.core.fql.serializer.StreamDeserializer)5 Intent (android.content.Intent)4 ListView (android.widget.ListView)4 Event (com.abewy.android.apps.klyph.core.fql.Event)4 AsyncRequest (com.abewy.android.apps.klyph.request.AsyncRequest)4 TextButtonItem (com.abewy.klyph.items.TextButtonItem)4 AbsListView (android.widget.AbsListView)3