Closed gkj17 closed 4 years ago
/**
@author user
*/
public abstract class BaseBannerLoader implements ImageLoaderInterface
@Override public void displayImage(Context context, Object path, BaseBannerItem imageView) { displayBanner(path, imageView); }
@Override public BaseBannerItem createImageView(Context context) { return new BaseBannerItem(context) { @Override protected View createView(Context context) { return createBanner(context); } }; }
/**
/**
public abstract class BaseBannerItem extends RelativeLayout {
public BaseBannerItem(Context context) {
this(context, null);
}
public BaseBannerItem(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public BaseBannerItem(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
private void init(Context context) {
addView(createView(context));
}
/**
* 创建布局
*
* @param context
* @return
*/
protected abstract View createView(Context context);
}
`activeBanner.setImageLoader(new BaseBannerLoader() { private SimpleDraweeView imageView;
@Override
public View createBanner(Context context) {
View view = View.inflate(context, R.layout.vip_banner_layout, null);
imageView = view.findViewById(R.id.banner_img);
return view;
}
@Override
public void displayBanner(Object path, BaseBannerItem item) {
AccountActive.ActiveItem data = (AccountActive.ActiveItem) path;
ImageLoadHelper.displayImage(imageView, data.pic);
}
}).setDelayTime(5000)`
不是 是这个意思,就是想图片这样 但是找不到BannerImageAdapter这个类
//—————————————————————————如果你想偷懒,而又只是图片轮播————————————————————————
banner.setAdapter(new BannerImageAdapter
@gkj17 你确定是用的最新版本吗?
文档说使用BannerImageAdapter<。。> 可是没有提供这个类 是忘记了吗。。。