本文整理汇总了Java中com.example.jingbin.cloudreader.bean.GankIoDataBean.ResultBean方法的典型用法代码示例。如果您正苦于以下问题:Java GankIoDataBean.ResultBean方法的具体用法?Java GankIoDataBean.ResultBean怎么用?Java GankIoDataBean.ResultBean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.example.jingbin.cloudreader.bean.GankIoDataBean
的用法示例。
在下文中一共展示了GankIoDataBean.ResultBean方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBindViewHolder
import com.example.jingbin.cloudreader.bean.GankIoDataBean; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(final GankIoDataBean.ResultBean resultsBean, final int position) {
/**
* 注意:DensityUtil.setViewMargin(itemView,true,5,3,5,0);
* 如果这样使用,则每个item的左右边距是不一样的,
* 这样item不能复用,所以下拉刷新成功后显示会闪一下
* 换成每个item设置上下左右边距是一样的话,系统就会复用,就消除了图片不能复用 闪跳的情况
*/
if (position % 2 == 0) {
DensityUtil.setViewMargin(itemView, false, 12, 6, 12, 0);
} else {
DensityUtil.setViewMargin(itemView, false, 6, 12, 12, 0);
}
binding.setBean(resultsBean);
// 仿抖动
binding.executePendingBindings();
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (listener != null) {
listener.onClick(resultsBean, position);
}
}
});
// binding.ivWelfare.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// ArrayList<String> imageuri = new ArrayList<String>();
// imageuri.add(resultsBean.getUrl());
// Bundle bundle = new Bundle();
// bundle.putInt("selet", 1);// 2,大图显示当前页数,1,头像,不显示页数
// bundle.putInt("code", 0);//第几张
// bundle.putStringArrayList("imageuri", imageuri);
// Intent intent = new Intent(v.getContext(), ViewBigImageActivity.class);
// intent.putExtras(bundle);
// v.getContext().startActivity(intent);
// }
// });
}
示例2: onBindViewHolder
import com.example.jingbin.cloudreader.bean.GankIoDataBean; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(final GankIoDataBean.ResultBean object, int position) {
if (isAll && "福利".equals(object.getType())) {
binding.ivAllWelfare.setVisibility(View.VISIBLE);
binding.llWelfareOther.setVisibility(View.GONE);
ImgLoadUtil.displayEspImage(object.getUrl(), binding.ivAllWelfare, 1);
} else {
binding.ivAllWelfare.setVisibility(View.GONE);
binding.llWelfareOther.setVisibility(View.VISIBLE);
}
if (isAll) {
binding.tvContentType.setVisibility(View.VISIBLE);
binding.tvContentType.setText(" · " + object.getType());
} else {
binding.tvContentType.setVisibility(View.GONE);
}
binding.setResultsBean(object);
binding.executePendingBindings();
// 显示gif图片会很耗内存
if (object.getImages() != null
&& object.getImages().size() > 0
&& !TextUtils.isEmpty(object.getImages().get(0))) {
// binding.ivAndroidPic.setVisibility(View.GONE);
binding.ivAndroidPic.setVisibility(View.VISIBLE);
ImgLoadUtil.displayGif(object.getImages().get(0), binding.ivAndroidPic);
} else {
binding.ivAndroidPic.setVisibility(View.GONE);
}
binding.llAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
WebViewActivity.loadUrl(v.getContext(), object.getUrl(), "加载中...");
}
});
}
示例3: onBindViewHolder
import com.example.jingbin.cloudreader.bean.GankIoDataBean; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(final GankIoDataBean.ResultBean object, int position) {
if (isAll && "福利".equals(object.getType())) {
binding.ivAllWelfare.setVisibility(View.VISIBLE);
binding.llWelfareOther.setVisibility(View.GONE);
ImgLoadUtil.displayEspImage(object.getUrl(), binding.ivAllWelfare, 1);
} else {
binding.ivAllWelfare.setVisibility(View.GONE);
binding.llWelfareOther.setVisibility(View.VISIBLE);
}
if (isAll) {
binding.tvContentType.setVisibility(View.VISIBLE);
binding.tvContentType.setText(" · " + object.getType());
} else {
binding.tvContentType.setVisibility(View.GONE);
}
// 显示gif图片会很耗内存
if (object.getImages() != null
&& object.getImages().size() > 0
&& !TextUtils.isEmpty(object.getImages().get(0))) {
binding.ivAndroidPic.setVisibility(View.VISIBLE);
ImgLoadUtil.displayGif(object.getImages().get(0), binding.ivAndroidPic);
} else {
binding.ivAndroidPic.setVisibility(View.GONE);
}
binding.setResultsBean(object);
binding.setCommand(AndroidAdapter.this);
binding.executePendingBindings();
}
示例4: openDetail
import com.example.jingbin.cloudreader.bean.GankIoDataBean; //导入方法依赖的package包/类
public void openDetail(GankIoDataBean.ResultBean object) {
WebViewActivity.loadUrl(context, object.getUrl(), "加载中...");
}