Search in sources :

Example 1 with DoulistUpdatedEvent

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

the class BaseDoulistResource method onLoadFinished.

@Override
protected void onLoadFinished(boolean more, int count, boolean successful, List<Doulist> response, ApiError error) {
    if (successful) {
        if (more) {
            append(response);
            getListener().onLoadDoulistListFinished(getRequestCode());
            getListener().onDoulistListAppended(getRequestCode(), Collections.unmodifiableList(response));
        } else {
            set(response);
            getListener().onLoadDoulistListFinished(getRequestCode());
            getListener().onDoulistListChanged(getRequestCode(), Collections.unmodifiableList(get()));
        }
        for (Doulist doulist : response) {
            EventBusUtils.postAsync(new DoulistUpdatedEvent(doulist, this));
        }
    } else {
        getListener().onLoadDoulistListFinished(getRequestCode());
        getListener().onLoadDoulistListError(getRequestCode(), error);
    }
}
Also used : DoulistUpdatedEvent(me.zhanghai.android.douya.eventbus.DoulistUpdatedEvent) Doulist(me.zhanghai.android.douya.network.api.info.frodo.Doulist)

Aggregations

DoulistUpdatedEvent (me.zhanghai.android.douya.eventbus.DoulistUpdatedEvent)1 Doulist (me.zhanghai.android.douya.network.api.info.frodo.Doulist)1