当前位置: 首页>>代码示例>>Java>>正文


Java FrontpageBean类代码示例

本文整理汇总了Java中com.example.jingbin.cloudreader.bean.FrontpageBean的典型用法代码示例。如果您正苦于以下问题:Java FrontpageBean类的具体用法?Java FrontpageBean怎么用?Java FrontpageBean使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FrontpageBean类属于com.example.jingbin.cloudreader.bean包,在下文中一共展示了FrontpageBean类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showBanncerPage

import com.example.jingbin.cloudreader.bean.FrontpageBean; //导入依赖的package包/类
/**
 * 轮播图
 */
public void showBanncerPage(final RequestImpl listener) {
    Subscription subscription = HttpClient.Builder.getTingServer().getFrontpage()
            .observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io())
            .subscribe(new Observer<FrontpageBean>() {
                @Override
                public void onCompleted() {
                }

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

                @Override
                public void onNext(FrontpageBean frontpageBean) {

                    frontpageBean.getResult().getFocus();

                    listener.loadSuccess(frontpageBean);
                }
            });
    listener.addSubscription(subscription);
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:27,代码来源:EverydayModel.java

示例2: handleCache

import com.example.jingbin.cloudreader.bean.FrontpageBean; //导入依赖的package包/类
public void handleCache() {
    ArrayList<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX> result = null;
    try {
        mBannerImages = (ArrayList<String>) ACache.get(CloudReaderApplication.getInstance()).getAsObject(Constants.BANNER_PIC);
        result = (ArrayList<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX>) ACache.get(CloudReaderApplication.getInstance()).getAsObject(Constants.BANNER_PIC_DATA);
    } catch (Exception ignored) {
    }
    if (mBannerImages != null && mBannerImages.size() > 0) {
        // 加上缓存使其可以点击
        everydayNavigator.showBannerView(mBannerImages, result);
    } else {
        showBanncerPage();
    }
    mLists = (ArrayList<List<AndroidBean>>) ACache.get(CloudReaderApplication.getInstance()).getAsObject(Constants.EVERYDAY_CONTENT);
    if (mLists != null && mLists.size() > 0) {
        everydayNavigator.showListView(mLists);
    } else {
        everydayNavigator.showRotaLoading();
        showRecyclerViewData();
    }
}
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:22,代码来源:EverydayViewModel.java

示例3: showBanncerPage

import com.example.jingbin.cloudreader.bean.FrontpageBean; //导入依赖的package包/类
/**
 * 轮播图
 */
public void showBanncerPage(final RequestImpl listener) {
    Subscription subscription = HttpClient.Builder.getTingServer().getFrontpage()
            .observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io())
            .subscribe(new Observer<FrontpageBean>() {
                @Override
                public void onCompleted() {
                }

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

                @Override
                public void onNext(FrontpageBean frontpageBean) {
                    listener.loadSuccess(frontpageBean);
                }
            });
    listener.addSubscription(subscription);
}
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:24,代码来源:EverydayModel.java

示例4: showBanncerPage

import com.example.jingbin.cloudreader.bean.FrontpageBean; //导入依赖的package包/类
private void showBanncerPage() {
    mEverydayModel.showBanncerPage(new RequestImpl() {
        @Override
        public void loadSuccess(Object object) {
            if (mBannerImages == null) {
                mBannerImages = new ArrayList<String>();
            } else {
                mBannerImages.clear();
            }
            FrontpageBean bean = (FrontpageBean) object;
            if (bean != null && bean.getResult() != null && bean.getResult().getFocus() != null && bean.getResult().getFocus().getResult() != null) {
                final ArrayList<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX> result = (ArrayList<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX>) bean.getResult().getFocus().getResult();
                if (result != null && result.size() > 0) {
                    for (int i = 0; i < result.size(); i++) {
                        //获取所有图片
                        mBannerImages.add(result.get(i).getRandpic());
                    }
                    everydayNavigator.showBannerView(mBannerImages, result);
                    ACache.get(CloudReaderApplication.getInstance()).remove(Constants.BANNER_PIC);
                    ACache.get(CloudReaderApplication.getInstance()).put(Constants.BANNER_PIC, mBannerImages);
                    ACache.get(CloudReaderApplication.getInstance()).remove(Constants.BANNER_PIC_DATA);
                    ACache.get(CloudReaderApplication.getInstance()).put(Constants.BANNER_PIC_DATA, result);
                }
            }
        }

        @Override
        public void loadFailed() {

        }

        @Override
        public void addSubscription(Subscription subscription) {
            activity.addSubscription(subscription);
        }
    });
}
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:38,代码来源:EverydayViewModel.java

示例5: showBannerView

import com.example.jingbin.cloudreader.bean.FrontpageBean; //导入依赖的package包/类
/**
 * 设置banner图
 */
@Override
public void showBannerView(ArrayList<String> mBannerImages, List<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX> result) {
    mHeaderBinding.banner.setImages(mBannerImages).setImageLoader(new GlideImageLoader()).start();
    if (result != null) {
        mHeaderBinding.banner.setOnBannerListener(position -> {
            if (result.get(position) != null && result.get(position).getCode() != null
                    && result.get(position).getCode().startsWith("http")) {
                WebViewActivity.loadUrl(getContext(), result.get(position).getCode(), "加载中...");
            }
        });
    }
}
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:16,代码来源:EverydayFragment.java

示例6: loadBannerPicture

import com.example.jingbin.cloudreader.bean.FrontpageBean; //导入依赖的package包/类
private void loadBannerPicture() {
    mEverydayModel.showBanncerPage(new RequestImpl() {
        @Override
        public void loadSuccess(Object object) {
            if (mBannerImages == null) {
                mBannerImages = new ArrayList<String>();
            } else {
                mBannerImages.clear();
            }
            FrontpageBean bean = (FrontpageBean) object;
            if (bean != null && bean.getResult() != null && bean.getResult().getFocus() != null && bean.getResult().getFocus().getResult() != null) {
                final List<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX> result = bean.getResult().getFocus().getResult();
                if (result != null && result.size() > 0) {
                    for (int i = 0; i < result.size(); i++) {
                        //获取所有图片
                        mBannerImages.add(result.get(i).getRandpic());
                    }
                    mHeaderBinding.banner.setImages(mBannerImages).setImageLoader(new GlideImageLoader()).start();
                    mHeaderBinding.banner.setOnBannerClickListener(new OnBannerClickListener() {
                        @Override
                        public void OnBannerClick(int position) {
                            position = position - 1;
                            // 链接没有做缓存,如果轮播图使用的缓存则点击图片无效
                            if (result.get(position) != null && result.get(position).getCode() != null
                                    && result.get(position).getCode().startsWith("http")) {
                                WebViewActivity.loadUrl(getContext(), result.get(position).getCode(), "加载中...");
                            }
                        }
                    });
                    maCache.remove(Constants.BANNER_PIC);
                    maCache.put(Constants.BANNER_PIC, mBannerImages, 30000);
                }
            }
        }

        @Override
        public void loadFailed() {

        }

        @Override
        public void addSubscription(Subscription subscription) {
            EverydayFragment.this.addSubscription(subscription);
        }
    });
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:47,代码来源:EverydayFragment.java

示例7: getFrontpage

import com.example.jingbin.cloudreader.bean.FrontpageBean; //导入依赖的package包/类
/**
 * 首页轮播图
 */
@GET("ting?from=android&version=5.8.1.0&channel=ppzs&operator=3&method=baidu.ting.plaza.index&cuid=89CF1E1A06826F9AB95A34DC0F6AAA14")
Observable<FrontpageBean> getFrontpage();
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:6,代码来源:HttpClient.java

示例8: showBannerView

import com.example.jingbin.cloudreader.bean.FrontpageBean; //导入依赖的package包/类
/**
 * 显示轮播图
 */
void showBannerView(ArrayList<String> mBannerImages, List<FrontpageBean.ResultBeanXXXXXXXXXXXXXX.FocusBean.ResultBeanX> result);
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:5,代码来源:EverydayNavigator.java


注:本文中的com.example.jingbin.cloudreader.bean.FrontpageBean类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。