add [新增-个人主页-点击图片展示]
This commit is contained in:
parent
fe2af299cb
commit
c7a4c9f501
@ -10,8 +10,10 @@ import com.yunbao.common.bean.BannerBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
public class UserHomeImgsViewHolder implements BannerViewHolder<String> {
|
||||
public onCLickListener onCLickListener;
|
||||
|
||||
@Override
|
||||
|
||||
public View createView(Context context, int position, String data) {
|
||||
// 返回mImageView页面布局
|
||||
ImageView imageView = new ImageView(context);
|
||||
@ -22,8 +24,24 @@ public class UserHomeImgsViewHolder implements BannerViewHolder<String> {
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
//Glide.with(context).load(data.getImageUrl()).into(imageView);
|
||||
ImgLoader.display(context, data, imageView);
|
||||
imageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onCLickListener != null) {
|
||||
onCLickListener.OnClick(position);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return imageView;
|
||||
}
|
||||
|
||||
public void setOnCLickListener(UserHomeImgsViewHolder.onCLickListener onCLickListener) {
|
||||
this.onCLickListener = onCLickListener;
|
||||
}
|
||||
|
||||
public interface onCLickListener {
|
||||
void OnClick(int position);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user