Search in sources :

Example 1 with FilmInfoLocationBean

use of com.example.changemax.sqhappy.model.network.entity.FilmInfoLocationBean in project PracticeFilmApplication by FOnlyJack.

the class FragmentOnePresenter method loadLocCityInfo.

@Override
public void loadLocCityInfo() {
    Subscription subscription = ApiDataManager.getFilmLocation(ApiConstants.FILM_INFORMATION_BASIS_LOCATIONID_HOST).doOnSubscribe(new Action0() {

        @Override
        public void call() {
            Logger.d("showLoading");
        }
    }).subscribe(new Subscriber<FilmInfoLocationBean>() {

        @Override
        public void onCompleted() {
            view.onCompleted();
        }

        @Override
        public void onError(Throwable e) {
            view.onError(e);
        }

        @Override
        public void onNext(FilmInfoLocationBean filmInfoLocationBean) {
            datalist.addAll(filmInfoLocationBean.getP());
            view.displayLocCityInformation(datalist);
            datalist.clear();
        }
    });
    compositeSubscription.add(subscription);
}
Also used : Action0(rx.functions.Action0) CompositeSubscription(rx.subscriptions.CompositeSubscription) Subscription(rx.Subscription) FilmInfoLocationBean(com.example.changemax.sqhappy.model.network.entity.FilmInfoLocationBean)

Aggregations

FilmInfoLocationBean (com.example.changemax.sqhappy.model.network.entity.FilmInfoLocationBean)1 Subscription (rx.Subscription)1 Action0 (rx.functions.Action0)1 CompositeSubscription (rx.subscriptions.CompositeSubscription)1