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


Java AndroidBean类代码示例

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


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

示例1: getAndroidBean

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
private AndroidBean getAndroidBean(List<AndroidBean> arrayList, int i, int androidSize) {

        AndroidBean androidBean = new AndroidBean();
        // 标题
        androidBean.setDesc(arrayList.get(i).getDesc());
        // 类型
        androidBean.setType(arrayList.get(i).getType());
        // 跳转链接
        androidBean.setUrl(arrayList.get(i).getUrl());
        // 随机图的url
        if (i < 3) {
            androidBean.setImage_url(ConstantsImageUrl.HOME_SIX_URLS[getRandom(3)]);//三小图
        } else if (androidSize == 4) {
            androidBean.setImage_url(ConstantsImageUrl.HOME_ONE_URLS[getRandom(1)]);//一图
        } else if (androidSize == 5) {
            androidBean.setImage_url(ConstantsImageUrl.HOME_TWO_URLS[getRandom(2)]);//两图
        } else if (androidSize >= 6) {
            androidBean.setImage_url(ConstantsImageUrl.HOME_SIX_URLS[getRandom(3)]);//三小图
        }
        return androidBean;
    }
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:22,代码来源:EverydayModel.java

示例2: addUrlList

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
private List<AndroidBean> addUrlList(List<AndroidBean> arrayList, int androidSize) {
        List<AndroidBean> tempList = new ArrayList<>();
        for (int i = 0; i < androidSize; i++) {
            AndroidBean androidBean = new AndroidBean();
            // 标题
            androidBean.setDesc(arrayList.get(i).getDesc());
            // 类型
            androidBean.setType(arrayList.get(i).getType());
            // 跳转链接
            androidBean.setUrl(arrayList.get(i).getUrl());
//            DebugUtil.error("---androidSize:  " + androidSize);
            // 随机图的url
            if (androidSize == 1) {
                androidBean.setImage_url(ConstantsImageUrl.HOME_ONE_URLS[getRandom(1)]);//一图
            } else if (androidSize == 2) {
                androidBean.setImage_url(ConstantsImageUrl.HOME_TWO_URLS[getRandom(2)]);//两图
            } else if (androidSize == 3) {
                androidBean.setImage_url(ConstantsImageUrl.HOME_SIX_URLS[getRandom(3)]);//三图
            }
            tempList.add(androidBean);
        }
        return tempList;
    }
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:24,代码来源:EverydayModel.java

示例3: onBindViewHolder

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
@Override
        public void onBindViewHolder(final List<AndroidBean> object, int position) {
            if ("福利".equals(object.get(0).getType())) {
                binding.tvOnePhotoTitle.setVisibility(View.GONE);
                binding.ivOnePhoto.setScaleType(ImageView.ScaleType.CENTER_CROP);
//                ImgLoadUtil.displayEspImage(object.get(0).getUrl(), binding.ivOnePhoto, 1);
                Glide.with(binding.ivOnePhoto.getContext())
                        .load(object.get(0).getUrl())
                        .crossFade(1500)
                        .placeholder(R.drawable.img_two_bi_one)
                        .error(R.drawable.img_two_bi_one)
                        .into(binding.ivOnePhoto);

            } else {
                binding.tvOnePhotoTitle.setVisibility(View.VISIBLE);
                setDes(object, 0, binding.tvOnePhotoTitle);
                displayRandomImg(1, 0, binding.ivOnePhoto, object);
            }
            setOnClick(binding.llOnePhoto, object.get(0));
        }
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:21,代码来源:EverydayAdapter.java

示例4: getACacheData

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
/**
 * 取缓存
 */
private void getACacheData() {
    if (!mIsFirst) {
        return;
    }

    if (mBannerImages != null && mBannerImages.size() > 0) {
        mHeaderBinding.banner.setImages(mBannerImages).setImageLoader(new GlideImageLoader()).start();
    } else {
        loadBannerPicture();
    }
    mLists = (ArrayList<List<AndroidBean>>) maCache.getAsObject(Constants.EVERYDAY_CONTENT);
    if (mLists != null && mLists.size() > 0) {
        setAdapter(mLists);
    } else {
        showRotaLoading(true);
        showContentData();
    }
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:22,代码来源:EverydayFragment.java

示例5: handleCache

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的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

示例6: showContentData

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
/**
 * 加载正文内容
 */
private void showContentData() {
    mEverydayModel.showRecyclerViewData(new RequestImpl() {
        @Override
        public void loadSuccess(Object object) {
            if (mLists != null) {
                mLists.clear();
            }
            mLists = (ArrayList<List<AndroidBean>>) object;
            if (mLists.size() > 0 && mLists.get(0).size() > 0) {
                setAdapter(mLists);
            } else {
                requestBeforeData();
            }
        }

        @Override
        public void loadFailed() {
            if (mLists != null && mLists.size() > 0) {
                return;
            }
            showError();
        }

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

示例7: requestBeforeData

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
/**
 * 没请求到数据就取缓存,没缓存一直请求前一天数据
 */
private void requestBeforeData() {
    mLists = (ArrayList<List<AndroidBean>>) maCache.getAsObject(Constants.EVERYDAY_CONTENT);
    if (mLists != null && mLists.size() > 0) {
        setAdapter(mLists);
    } else {
        // 一直请求,知道请求到数据为止
        ArrayList<String> lastTime = TimeUtil.getLastTime(year, month, day);
        mEverydayModel.setData(lastTime.get(0), lastTime.get(1), lastTime.get(2));
        year = lastTime.get(0);
        month = lastTime.get(1);
        day = lastTime.get(2);
        showContentData();
    }
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:18,代码来源:EverydayFragment.java

示例8: showRecyclerViewData

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
private void showRecyclerViewData() {
    mEverydayModel.showRecyclerViewData(new RequestImpl() {
        @Override
        public void loadSuccess(Object object) {
            if (mLists != null) {
                mLists.clear();
            }
            mLists = (ArrayList<List<AndroidBean>>) object;
            if (mLists.size() > 0 && mLists.get(0).size() > 0) {
                everydayNavigator.showListView(mLists);
            } else {
                mLists = (ArrayList<List<AndroidBean>>) ACache.get(activity.getContext()).getAsObject(Constants.EVERYDAY_CONTENT);
                if (mLists != null && mLists.size() > 0) {
                    everydayNavigator.showListView(mLists);
                } else {
                    // 一直请求,知道请求到数据为止
                    ArrayList<String> lastTime = TimeUtil.getLastTime(year, month, day);
                    mEverydayModel.setData(lastTime.get(0), lastTime.get(1), lastTime.get(2));
                    year = lastTime.get(0);
                    month = lastTime.get(1);
                    day = lastTime.get(2);
                    showRecyclerViewData();
                }
            }
        }

        @Override
        public void loadFailed() {
            if (mLists != null && mLists.size() > 0) {
                return;
            }
            everydayNavigator.showErrorView();
        }

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

示例9: setDes

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
private void setDes(List<AndroidBean> object, int position, TextView textView) {
    textView.setText(object.get(position).getDesc());
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:4,代码来源:EverydayAdapter.java

示例10: displayRandomImg

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
private void displayRandomImg(int imgNumber, int position, ImageView imageView, List<AndroidBean> object) {
//        DebugUtil.error("-----Image_url: "+object.get(position).getImage_url());
        ImgLoadUtil.displayRandom(imgNumber, object.get(position).getImage_url(), imageView);
    }
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:5,代码来源:EverydayAdapter.java

示例11: showListView

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
/**
 * 显示列表内容
 */
@Override
public void showListView(ArrayList<List<AndroidBean>> mLists) {
    setAdapter(mLists);
}
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:8,代码来源:EverydayFragment.java

示例12: showListView

import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
/**
 * 显示列表数据
 */
void showListView(ArrayList<List<AndroidBean>> mLists);
 
开发者ID:youlookwhat,项目名称:CloudReader,代码行数:5,代码来源:EverydayNavigator.java


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