當前位置: 首頁>>代碼示例>>Java>>正文


Java HotMovieBean類代碼示例

本文整理匯總了Java中com.example.jingbin.cloudreader.bean.HotMovieBean的典型用法代碼示例。如果您正苦於以下問題:Java HotMovieBean類的具體用法?Java HotMovieBean怎麽用?Java HotMovieBean使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HotMovieBean類屬於com.example.jingbin.cloudreader.bean包,在下文中一共展示了HotMovieBean類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getHotMovie

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
public void getHotMovie(int start, int count) {
    oneRepo.getMovieTop250(start, count, new OnMovieLoadListener() {
        @Override
        public void onSuccess(HotMovieBean hotMovieBean) {
            if (loadListener != null) {
                loadListener.onSuccess(hotMovieBean);
            }
        }

        @Override
        public void onFailure() {
            if (loadListener != null) {
                loadListener.onFailure();
            }
        }
    });
}
 
開發者ID:youlookwhat,項目名稱:CloudReader,代碼行數:18,代碼來源:DoubanTopViewModel.java

示例2: getHotMovie

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
public MutableLiveData<HotMovieBean> getHotMovie() {
    final MutableLiveData<HotMovieBean> data = new MutableLiveData<>();
    HttpClient.Builder.getDouBanService().getHotMovie().subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<HotMovieBean>() {
        @Override
        public void onCompleted() {
        }

        @Override
        public void onError(Throwable e) {
            data.setValue(null);
        }

        @Override
        public void onNext(HotMovieBean hotMovieBean) {
            if (hotMovieBean != null) {
                data.setValue(hotMovieBean);
            }
        }
    });
    return data;
}
 
開發者ID:youlookwhat,項目名稱:CloudReader,代碼行數:23,代碼來源:OneRepository.java

示例3: getMovieTop250

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
public void getMovieTop250(int start, int count, OnMovieLoadListener loadListener) {
    HttpClient.Builder.getDouBanService().getMovieTop250(start, count).subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<HotMovieBean>() {
        @Override
        public void onCompleted() {
        }

        @Override
        public void onError(Throwable e) {
            if (loadListener != null) {
                loadListener.onFailure();
            }
        }

        @Override
        public void onNext(HotMovieBean hotMovieBean) {
            if (hotMovieBean != null) {
                if (loadListener != null) {
                    loadListener.onSuccess(hotMovieBean);
                }
            }
        }
    });
}
 
開發者ID:youlookwhat,項目名稱:CloudReader,代碼行數:25,代碼來源:OneRepository.java

示例4: onActivityCreated

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    showContentView();
    aCache = ACache.get(getActivity());
    oneAdapter = new OneAdapter(activity);
    mHotMovieBean = (HotMovieBean) aCache.getAsObject(Constants.ONE_HOT_MOVIE);
    isPrepared = true;
    DebugUtil.error("---OneFragment   --onActivityCreated");
}
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:11,代碼來源:OneFragment.java

示例5: loadHotMovie

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
private void loadHotMovie() {
        Subscription subscription = HttpClient.Builder.getDouBanService().getHotMovie().subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<HotMovieBean>() {
                    @Override
                    public void onCompleted() {
                        showContentView();
                    }

                    @Override
                    public void onError(Throwable e) {
                        showContentView();
                        if (oneAdapter != null && oneAdapter.getItemCount() == 0) {
                            showError();
                        }
                    }

                    @Override
                    public void onNext(HotMovieBean hotMovieBean) {
                        if (hotMovieBean != null) {
                            aCache.remove(Constants.ONE_HOT_MOVIE);
                            // 保存12個小時
                            aCache.put(Constants.ONE_HOT_MOVIE, hotMovieBean, 43200);
                            setAdapter(hotMovieBean);
                            // 保存請求的日期
                            SPUtils.putString("one_data", TimeUtil.getData());
                            // 刷新結束
                            mIsLoading = false;
                        }

                        //構造器中,第一個參數表示列數或者行數,第二個參數表示滑動方向,瀑布流
//                        bindingContentView.listOne.setLayoutManager(new StaggeredGridLayoutManager(4,StaggeredGridLayoutManager.VERTICAL));
                        // GridView
//                        bindingContentView.listOne.setLayoutManager(new GridLayoutManager(getActivity(), 2));
                    }
                });
        addSubscription(subscription);
    }
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:38,代碼來源:OneFragment.java

示例6: setAdapter

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
private void setAdapter(HotMovieBean hotMovieBean) {

        LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
        mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        bindingView.listOne.setLayoutManager(mLayoutManager);

        // 加上這兩行代碼,下拉出提示才不會產生出現刷新頭的bug,不加拉不下來
        bindingView.listOne.setPullRefreshEnabled(false);
        bindingView.listOne.clearHeader();

        bindingView.listOne.setLoadingMoreEnabled(false);
        // 需加,不然滑動不流暢
        bindingView.listOne.setNestedScrollingEnabled(false);
        bindingView.listOne.setHasFixedSize(false);

        if (mHeaderView == null) {
            mHeaderView = View.inflate(getContext(), R.layout.header_item_one, null);
            View llMovieTop = mHeaderView.findViewById(R.id.ll_movie_top);
            ImageView ivImg = (ImageView) mHeaderView.findViewById(R.id.iv_img);
            ImgLoadUtil.displayRandom(3, ConstantsImageUrl.ONE_URL_01,ivImg);
            llMovieTop.setOnClickListener(new PerfectClickListener() {
                @Override
                protected void onNoDoubleClick(View v) {
                    DoubanTopActivity.start(v.getContext());
                }
            });
        }
        bindingView.listOne.addHeaderView(mHeaderView);
        oneAdapter.clear();
        oneAdapter.addAll(hotMovieBean.getSubjects());
        bindingView.listOne.setAdapter(oneAdapter);
        oneAdapter.notifyDataSetChanged();

        isFirst = false;
    }
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:36,代碼來源:OneFragment.java

示例7: getHotMovie

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
public LiveData<HotMovieBean> getHotMovie() {
    if (hotMovieBean == null
            || hotMovieBean.getValue() == null
            || hotMovieBean.getValue().getSubjects() == null
            || hotMovieBean.getValue().getSubjects().size() == 0) {
        hotMovieBean = new MutableLiveData<>();
        return loadHotMovie();
    } else {
        return hotMovieBean;
    }
}
 
開發者ID:youlookwhat,項目名稱:CloudReader,代碼行數:12,代碼來源:OneViewModel.java

示例8: onSuccess

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
@Override
public void onSuccess(HotMovieBean hotMovieBean) {
    showContentView();
    if (mStart == 0) {
        if (hotMovieBean != null
                && hotMovieBean.getSubjects() != null
                && hotMovieBean.getSubjects().size() > 0) {

            mDouBanTopAdapter.clear();
            mDouBanTopAdapter.addAll(hotMovieBean.getSubjects());
            mDouBanTopAdapter.notifyDataSetChanged();
        } else {
            bindingView.xrvTop.setVisibility(View.GONE);
            bindingView.xrvTop.refreshComplete();
            if (mDouBanTopAdapter.getItemCount() == 0) {
                showError();
            }
        }
    } else {
        if (hotMovieBean != null
                && hotMovieBean.getSubjects() != null
                && hotMovieBean.getSubjects().size() > 0) {
            bindingView.xrvTop.refreshComplete();
            mDouBanTopAdapter.addAll(hotMovieBean.getSubjects());
            mDouBanTopAdapter.notifyDataSetChanged();
        } else {
            bindingView.xrvTop.noMoreLoading();
        }
    }
}
 
開發者ID:youlookwhat,項目名稱:CloudReader,代碼行數:31,代碼來源:DoubanTopActivity.java

示例9: onActivityCreated

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    showContentView();
    initRecyclerView();
    aCache = ACache.get(getActivity());
    mHotMovieBean = (HotMovieBean) aCache.getAsObject(Constants.ONE_HOT_MOVIE);
    oneViewModel = ViewModelProviders.of(this).get(OneViewModel.class);
    isPrepared = true;
}
 
開發者ID:youlookwhat,項目名稱:CloudReader,代碼行數:11,代碼來源:OneFragment.java

示例10: setAdapter

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
private void setAdapter(HotMovieBean hotMovieBean) {
    oneAdapter.clear();
    oneAdapter.addAll(hotMovieBean.getSubjects());
    bindingView.listOne.setAdapter(oneAdapter);
    oneAdapter.notifyDataSetChanged();

    isFirst = false;
}
 
開發者ID:youlookwhat,項目名稱:CloudReader,代碼行數:9,代碼來源:OneFragment.java

示例11: loadDouBanTop250

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
private void loadDouBanTop250() {
    Subscription get = HttpClient.Builder.getDouBanService().getMovieTop250(mStart, mCount)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Observer<HotMovieBean>() {
                @Override
                public void onCompleted() {
                    showContentView();
                }

                @Override
                public void onError(Throwable e) {
                    bindingView.xrvTop.refreshComplete();
                    if (mDouBanTopAdapter.getItemCount() == 0) {
                        showError();
                    }
                }

                @Override
                public void onNext(HotMovieBean hotMovieBean) {
                    if (mStart == 0) {
                        if (hotMovieBean != null && hotMovieBean.getSubjects() != null && hotMovieBean.getSubjects().size() > 0) {

                            mDouBanTopAdapter.clear();
                            mDouBanTopAdapter.addAll(hotMovieBean.getSubjects());
                            //構造器中,第一個參數表示列數或者行數,第二個參數表示滑動方向,瀑布流
                            bindingView.xrvTop.setLayoutManager(new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL));
                            bindingView.xrvTop.setAdapter(mDouBanTopAdapter);
                            bindingView.xrvTop.setPullRefreshEnabled(false);
                            bindingView.xrvTop.clearHeader();
                            bindingView.xrvTop.setLoadingMoreEnabled(true);
                            mDouBanTopAdapter.notifyDataSetChanged();
                        } else {
                            bindingView.xrvTop.setVisibility(View.GONE);
                        }
                    } else {
                        if (hotMovieBean != null && hotMovieBean.getSubjects() != null && hotMovieBean.getSubjects().size() > 0) {
                            bindingView.xrvTop.refreshComplete();
                            mDouBanTopAdapter.addAll(hotMovieBean.getSubjects());
                            mDouBanTopAdapter.notifyDataSetChanged();
                        } else {
                            bindingView.xrvTop.noMoreLoading();
                        }
                    }

                }
            });
    addSubscription(get);
}
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:50,代碼來源:DoubanTopActivity.java

示例12: setHotMovieBean

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
private void setHotMovieBean(MutableLiveData<HotMovieBean> hotMovieBean) {
    this.hotMovieBean = hotMovieBean;
}
 
開發者ID:youlookwhat,項目名稱:CloudReader,代碼行數:4,代碼來源:OneViewModel.java

示例13: loadHotMovie

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
private MutableLiveData<HotMovieBean> loadHotMovie() {
    MutableLiveData<HotMovieBean> hotMovie = oneRepo.getHotMovie();
    setHotMovieBean(hotMovie);
    return hotMovie;
}
 
開發者ID:youlookwhat,項目名稱:CloudReader,代碼行數:6,代碼來源:OneViewModel.java

示例14: getHotMovie

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
/**
 * 豆瓣熱映電影,每日更新
 */
@GET("v2/movie/in_theaters")
Observable<HotMovieBean> getHotMovie();
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:6,代碼來源:HttpClient.java

示例15: getMovieTop250

import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
/**
 * 獲取豆瓣電影top250
 *
 * @param start 從多少開始,如從"0"開始
 * @param count 一次請求的數目,如"10"條,最多100
 */
@GET("v2/movie/top250")
Observable<HotMovieBean> getMovieTop250(@Query("start") int start, @Query("count") int count);
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:9,代碼來源:HttpClient.java


注:本文中的com.example.jingbin.cloudreader.bean.HotMovieBean類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。