use of com.bumptech.glide.request.RequestOptions in project BGARefreshLayout-Android by bingoogolapple.
the class ViewPagerActivity 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) {
}
});
}
use of com.bumptech.glide.request.RequestOptions in project BGARefreshLayout-Android by bingoogolapple.
the class SwipeRecyclerViewActivity 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) {
}
});
}
use of com.bumptech.glide.request.RequestOptions 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) {
}
});
}
use of com.bumptech.glide.request.RequestOptions in project bdcodehelper by boredream.
the class GlideHelper method loadImg.
public static void loadImg(ImageView iv, String url, int defaultImg) {
RequestOptions options = new RequestOptions();
if (defaultImg != -1) {
options = options.placeholder(defaultImg).error(defaultImg);
}
Glide.with(iv.getContext()).load(url).apply(options).into(iv);
}
use of com.bumptech.glide.request.RequestOptions in project bdcodehelper by boredream.
the class GlideHelper method loadOvalImg.
public static void loadOvalImg(ImageView iv, String url, int defaultImg) {
RequestOptions options = new RequestOptions();
if (defaultImg != -1) {
options = options.placeholder(defaultImg).error(defaultImg);
}
Glide.with(iv.getContext()).load(url).apply(RequestOptions.circleCropTransform()).apply(options).into(iv);
}
Aggregations