use of com.abewy.android.apps.klyph.core.request.Response in project Klyph by jonathangerbaud.
the class KlyphListActivity method refresh.
protected void refresh() {
startLoading();
Log.i(TAG, "request = " + requestType + ", id = " + elementId + ", offset = " + offset);
AsyncRequest request = new AsyncRequest(requestType, elementId, offset, new AsyncRequest.Callback() {
public void onComplete(Response response) {
Log.i(TAG, "onCompleted");
onRequestComplete(response);
}
});
request.execute();
}
use of com.abewy.android.apps.klyph.core.request.Response in project Klyph by jonathangerbaud.
the class AlbumPhotos method downloadAlbum.
private void downloadAlbum() {
if (hasNoMoreData() == false) {
Toast.makeText(getActivity(), R.string.fetch_photos_from_album, Toast.LENGTH_SHORT).show();
new AsyncRequest(Query.ALBUM_PHOTOS_ALL, getElementId(), "", new AsyncRequest.Callback() {
@Override
public void onComplete(Response response) {
if (response.getError() == null) {
downloadAlbum(response.getGraphObjectList());
}
}
}).execute();
} else {
List<GraphObject> photos = new ArrayList<GraphObject>();
for (GraphObject graphObject : getAdapter().getItems()) {
photos.add(graphObject);
}
downloadAlbum(photos);
}
}
use of com.abewy.android.apps.klyph.core.request.Response in project Klyph by jonathangerbaud.
the class AlbumVideos method downloadAlbum.
private void downloadAlbum() {
if (hasNoMoreData() == false) {
Toast.makeText(getActivity(), R.string.fetch_videos_from_album, Toast.LENGTH_SHORT).show();
new AsyncRequest(Query.ALBUM_VIDEOS_ALL, getElementId(), "", new AsyncRequest.Callback() {
@Override
public void onComplete(Response response) {
if (response.getError() == null) {
downloadAlbum(response.getGraphObjectList());
}
}
}).execute();
} else {
List<GraphObject> videos = new ArrayList<GraphObject>();
for (GraphObject graphObject : getAdapter().getItems()) {
videos.add(graphObject);
}
downloadAlbum(videos);
}
}
use of com.abewy.android.apps.klyph.core.request.Response in project Klyph by jonathangerbaud.
the class KlyphFragment2 method loadNewest.
protected void loadNewest() {
newestLoading = true;
if (getAdapter().getFirstItem() instanceof TextButtonItem) {
getAdapter().removeFirst();
getAdapter().notifyDataSetChanged();
}
String offset = null;
/*
* if (KlyphPreferences.getNewsfeedGoToTop() == false && getAdapter().getCount() > 0 && getAdapter().getCount() > insertNewestToIndex)
* {
* GraphObject first = (GraphObject) getAdapter().getItem(insertNewestToIndex);
* offset = getNewestOffset(first);
* }
*/
AsyncRequest request = new AsyncRequest(requestNewestType, getElementId(), offset, new AsyncRequest.Callback() {
public void onComplete(Response response) {
Log.i("StreamListFragment", "onCompleted");
onRequestNewestComplete(response);
}
});
request.execute();
}
use of com.abewy.android.apps.klyph.core.request.Response in project Klyph by jonathangerbaud.
the class Notifications method setNotificationRead.
private void setNotificationRead(Notification notification) {
notification.setIs_unread(false);
new AsyncRequest(Query.POST_READ_NOTIFICATION, notification.getNotification_id(), "", new AsyncRequest.Callback() {
@Override
public void onComplete(Response response) {
Log.d("NotificationsNotifications", "result " + response.getError());
}
}).execute();
}
Aggregations