Search in sources :

Example 26 with GraphObject

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

the class EventFragment method onGridItemClick.

@Override
protected void onGridItemClick(KlyphGridView gridView, View view, int position, long id) {
    GraphObject o = (GraphObject) gridView.getItemAtPosition(position);
    if (o instanceof Stream) {
        Stream stream = (Stream) o;
        startActivity(Klyph.getIntentForGraphObject(getActivity(), stream));
    }
}
Also used : Stream(com.abewy.android.apps.klyph.core.fql.Stream) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 27 with GraphObject

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

the class UserLikeRequest 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)

Example 28 with GraphObject

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

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

the class UploadableAlbumRequest method handleResult.

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

Example 30 with GraphObject

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

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