本文整理汇总了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;
}
示例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;
}
示例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));
}
示例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();
}
}
示例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();
}
}
示例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);
}
});
}
示例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();
}
}
示例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);
}
});
}
示例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());
}
示例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);
}
示例11: showListView
import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
/**
* 显示列表内容
*/
@Override
public void showListView(ArrayList<List<AndroidBean>> mLists) {
setAdapter(mLists);
}
示例12: showListView
import com.example.jingbin.cloudreader.bean.AndroidBean; //导入依赖的package包/类
/**
* 显示列表数据
*/
void showListView(ArrayList<List<AndroidBean>> mLists);