轮播图
程序员文章站
2022-05-01 19:24:10
...
//无限轮播
HttpUtil.httpAsyncTask(bannerstr, new HttpUtil.CallBackString() {
private ArrayList<BannerOne> result;
@Override
public void getData(String s) {
Gson gson=new Gson();
final BannerTwo bannerTwo=gson.fromJson(s,BannerTwo.class);
result = bannerTwo.getResult();
banner.setImages(result);
banner.setImageLoader(new ImageLoader() {
@Override
public void displayImage(Context context, Object path, ImageView imageView) {
BannerOne bannerOne= (BannerOne) path;
Glide.with(MainActivity.this).load(bannerOne.getImageUrl()).into(imageView);
}
});
banner.isAutoPlay(true);
banner.setDelayTime(1000);
banner.start();
}
});
上一篇: 分析MySQL的数据类型以及建库策略