Search in sources :

Example 1 with ReviewUpdatedEvent

use of me.zhanghai.android.douya.eventbus.ReviewUpdatedEvent in project Douya by DreaminginCodeZH.

the class BaseReviewListResource method onLoadFinished.

private void onLoadFinished(boolean more, int count, boolean successful, List<Review> response, VolleyError error) {
    getListener().onLoadReviewListFinished(getRequestCode());
    if (successful) {
        if (more) {
            append(response);
            getListener().onReviewListAppended(getRequestCode(), Collections.unmodifiableList(response));
        } else {
            set(response);
            getListener().onReviewListChanged(getRequestCode(), Collections.unmodifiableList(get()));
        }
        for (Review review : response) {
            EventBusUtils.postAsync(new ReviewUpdatedEvent(review, this));
        }
    } else {
        getListener().onLoadReviewListError(getRequestCode(), error);
    }
}
Also used : ReviewUpdatedEvent(me.zhanghai.android.douya.eventbus.ReviewUpdatedEvent) Review(me.zhanghai.android.douya.network.api.info.frodo.Review)

Aggregations

ReviewUpdatedEvent (me.zhanghai.android.douya.eventbus.ReviewUpdatedEvent)1 Review (me.zhanghai.android.douya.network.api.info.frodo.Review)1