use of com.abewy.android.apps.klyph.core.fql.serializer.PhotoDeserializer in project Klyph by jonathangerbaud.
the class AlbumPhotosAllRequest 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;
}
use of com.abewy.android.apps.klyph.core.fql.serializer.PhotoDeserializer in project Klyph by jonathangerbaud.
the class AlbumPhotosRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray result) {
PhotoDeserializer deserializer = new PhotoDeserializer();
ArrayList<GraphObject> photos = (ArrayList<GraphObject>) deserializer.deserializeArray(result);
setHasMoreData(photos.size() >= 50);
return photos;
}
use of com.abewy.android.apps.klyph.core.fql.serializer.PhotoDeserializer in project Klyph by jonathangerbaud.
the class UserProfilePhotoRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
PhotoDeserializer deserializer = new PhotoDeserializer();
ArrayList<GraphObject> photos = (ArrayList<GraphObject>) deserializer.deserializeArray(result[0]);
Log.d("UserProfileRequest", "photos " + photos.size());
ProfilePicDeserializer ppDeserializer = new ProfilePicDeserializer();
ArrayList<GraphObject> pictures = (ArrayList<GraphObject>) ppDeserializer.deserializeArray(result[1]);
Log.d("UserProfileRequest", "pictures " + pictures.size());
ArrayList<GraphObject> selectedPhoto = new ArrayList<GraphObject>();
if (pictures.size() > 0) {
ProfilePic pic = (ProfilePic) pictures.get(0);
String url = pic.getUrl();
url = url.substring(url.indexOf("_") + 1);
url = url.substring(0, url.lastIndexOf("_"));
for (GraphObject graphObject : photos) {
Photo photo = (Photo) graphObject;
for (Image image : photo.getImages()) {
String imageUrl = image.getSource();
imageUrl = imageUrl.substring(imageUrl.indexOf("_") + 1);
imageUrl = imageUrl.substring(0, imageUrl.lastIndexOf("_"));
Log.d("UserProfileRequest", url + " " + imageUrl);
if (url.equals(imageUrl)) {
selectedPhoto.add(photo);
Log.d("UserProfileRequest", "id " + photo.getObject_id());
setHasMoreData(false);
return selectedPhoto;
}
}
}
}
setHasMoreData(false);
return selectedPhoto;
}
use of com.abewy.android.apps.klyph.core.fql.serializer.PhotoDeserializer in project Klyph by jonathangerbaud.
the class PhotoRequest method handleResult.
@Override
public ArrayList<GraphObject> handleResult(JSONArray[] result) {
JSONArray photo = result[0];
JSONArray profiles = result[1];
JSONArray album = result[2];
JSONArray pics = result[3];
JSONArray places = result[4];
assocData2(photo, profiles, "owner", "id", "owner_name", "name", "owner_type", "type");
assocData2(photo, profiles, "owner", "id", "target_name", "name", "target_type", "type");
assocData(photo, album, "album_object_id", "object_id", "album_name", "name");
assocData(photo, pics, "owner", "id", "owner_pic", "url");
assocData(photo, places, "place", "page_id", "place_name", "name");
PhotoDeserializer deserializer = new PhotoDeserializer();
ArrayList<GraphObject> list = (ArrayList<GraphObject>) deserializer.deserializeArray(photo);
setHasMoreData(false);
return list;
}
Aggregations