use of cn.bingoogolapple.bgabanner.BGABanner in project BGARefreshLayout-Android by bingoogolapple.
the class NormalRecyclerViewActivity method initBanner.
private void initBanner() {
mBanner.setAdapter(new BGABanner.Adapter<ImageView, String>() {
@Override
public void fillBannerItem(BGABanner banner, ImageView itemView, String model, int position) {
Glide.with(itemView.getContext()).load(model).apply(new RequestOptions().placeholder(R.mipmap.holder).error(R.mipmap.holder).dontAnimate()).thumbnail(0.1f).into(itemView);
}
});
App.getInstance().getEngine().getBannerModel().enqueue(new Callback<BannerModel>() {
@Override
public void onResponse(Call<BannerModel> call, Response<BannerModel> response) {
BannerModel bannerModel = response.body();
mBanner.setData(R.layout.view_image, bannerModel.imgs, bannerModel.tips);
}
@Override
public void onFailure(Call<BannerModel> call, Throwable t) {
}
});
}
Aggregations