本文整理匯總了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();
}
}
});
}
示例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;
}
示例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);
}
}
}
});
}
示例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");
}
示例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);
}
示例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;
}
示例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;
}
}
示例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();
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例12: setHotMovieBean
import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
private void setHotMovieBean(MutableLiveData<HotMovieBean> hotMovieBean) {
this.hotMovieBean = hotMovieBean;
}
示例13: loadHotMovie
import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
private MutableLiveData<HotMovieBean> loadHotMovie() {
MutableLiveData<HotMovieBean> hotMovie = oneRepo.getHotMovie();
setHotMovieBean(hotMovie);
return hotMovie;
}
示例14: getHotMovie
import com.example.jingbin.cloudreader.bean.HotMovieBean; //導入依賴的package包/類
/**
* 豆瓣熱映電影,每日更新
*/
@GET("v2/movie/in_theaters")
Observable<HotMovieBean> getHotMovie();
示例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);