请求接口Banner普通轮播图(Glide)

//Retrofit  请求下来接口
  NetWork.getNetWork().create(ServiceAPI.class).getbanner().enqueue(new Callback() {
            @Override
            public void onResponse(Call call, Response response) {

                List result = response.body().getResult();
               
                List images = new ArrayList<>();
                for (int i = 0; i < result.size(); i++) {
                    images.add(result.get(i).getImageUrl());
                }

                //设置banner
                banner.setImages(images);
                banner.setDelayTime(3000);
                banner.setImageLoader(new ImageLoader() {
                    @Override
                    public void displayImage(Context context, Object path, ImageView imageView) {
                        Glide.with(MainActivity.this).load(path).into(imageView);
                    }
                });
                banner.start();
            }

            @Override
            public void onFailure(Call call, Throwable t) {

            }
        });

你可能感兴趣的:(请求接口Banner普通轮播图(Glide))