Search in sources :

Example 1 with StreamLikeCount

use of com.abewy.android.apps.klyph.fragment.StreamFragment.StreamLikeCount in project Klyph by jonathangerbaud.

the class ImageFragment method populate.

@Override
protected void populate(List<GraphObject> data) {
    if (data.size() > 0) {
        GraphObject object = data.get(0);
        if (object instanceof Photo) {
            Photo photo = (Photo) data.get(0);
            // if (this.photo == null)
            // {
            setPhoto(photo);
            // }
            getAdapter().add(photo);
            likeTitle = new StreamLikeCount();
            getAdapter().add(likeTitle);
            refreshLikeCount();
            data.remove(0);
            super.populate(data);
            setRequestType(Query.COMMENTS);
            setNoMoreData(false);
            (getActivity()).invalidateOptionsMenu();
            refresh();
        } else {
            super.populate(data);
            setNoMoreData(!isFirstLoad() && (data.size() == 0 || (getRequest().getPagingNext() == null || getRequest().getPagingNext().length() == 0)));
            setOffset(getAfterCursor());
        }
    } else {
        super.populate(data);
        setNoMoreData(!isFirstLoad() && (data.size() == 0 || (getRequest().getPagingNext() == null || getRequest().getPagingNext().length() == 0)));
        setOffset(getAfterCursor());
    }
}
Also used : Photo(com.abewy.android.apps.klyph.core.fql.Photo) StreamLikeCount(com.abewy.android.apps.klyph.fragment.StreamFragment.StreamLikeCount) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Aggregations

Photo (com.abewy.android.apps.klyph.core.fql.Photo)1 GraphObject (com.abewy.android.apps.klyph.core.graph.GraphObject)1 StreamLikeCount (com.abewy.android.apps.klyph.fragment.StreamFragment.StreamLikeCount)1