use of com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions in project TicktockMusic by Lauzy.
the class GlideImageLoaderStrategy method display.
@Override
public void display(Context context, ImageConfig imageConfig) {
RequestOptions options = getOptions(context, imageConfig);
Object url = getPath(imageConfig);
if (!imageConfig.isAsBitmap()) {
RequestBuilder<Drawable> requestBuilder = Glide.with(context).load(url).apply(options);
if (!imageConfig.isRound() && imageConfig.getDuration() != 0) {
requestBuilder = requestBuilder.transition(new DrawableTransitionOptions().crossFade(imageConfig.getDuration()));
}
requestBuilder.into(imageConfig.getImageView());
} else {
RequestBuilder<Bitmap> requestBuilder = Glide.with(context).asBitmap().load(url).apply(options);
if (!imageConfig.isRound() && imageConfig.getDuration() != 0) {
requestBuilder = requestBuilder.transition(new BitmapTransitionOptions().crossFade(imageConfig.getDuration()));
}
requestBuilder.into(imageConfig.getTarget());
}
}
use of com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions in project 91Pop by DanteAndroid.
the class FavoriteAdapter method convert.
@Override
protected void convert(BaseViewHolder helper, UnLimit91PornItem item) {
helper.setText(R.id.tv_91porn_item_title, item.getTitle() + " (" + item.getDuration() + ")");
helper.setText(R.id.tv_91porn_item_info, item.getInfo());
ImageView simpleDraweeView = helper.getView(R.id.iv_91porn_item_img);
Uri uri = Uri.parse(item.getImgUrl());
GlideApp.with(helper.itemView).load(uri).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).into(simpleDraweeView);
helper.addOnClickListener(R.id.right_menu_delete);
}
use of com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions in project 91Pop by DanteAndroid.
the class HistoryAdapter method convert.
@Override
protected void convert(BaseViewHolder helper, UnLimit91PornItem item) {
helper.setText(R.id.tv_91porn_item_title, item.getTitle() + " (" + item.getDuration() + ")");
helper.setText(R.id.tv_91porn_item_info, item.getInfo());
ImageView simpleDraweeView = helper.getView(R.id.iv_91porn_item_img);
Uri uri = Uri.parse(item.getImgUrl());
GlideApp.with(helper.itemView).load(uri).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).into(simpleDraweeView);
helper.addOnClickListener(R.id.right_menu_delete);
}
use of com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions in project 91Pop by DanteAndroid.
the class MeiZiTuAdapter method convert.
@Override
protected void convert(BaseViewHolder helper, MeiZiTu item) {
ImageView imageView = helper.getView(R.id.iv_item_mei_zi_tu);
GlideApp.with(helper.itemView.getContext()).load(buildGlideUrl(item.getThumbUrl())).transition(new DrawableTransitionOptions().crossFade(300)).into(imageView);
int height;
if (!heightMap.containsKey(item.getThumbUrl())) {
height = item.getHeight() * width / item.getWidth();
heightMap.put(item.getThumbUrl(), height);
} else {
height = heightMap.get(item.getThumbUrl());
}
StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) helper.itemView.getLayoutParams();
layoutParams.height = height;
helper.itemView.setLayoutParams(layoutParams);
}
use of com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions in project 91Pop by DanteAndroid.
the class PigAvAdapter method convert.
@Override
protected void convert(BaseViewHolder helper, PigAv item) {
helper.setText(R.id.tv_item_pig_av_title, item.getTitle());
int height;
if (!heightMap.containsKey(item.getImgUrl())) {
height = item.getImgHeight() * width / item.getImgWidth() + 15;
heightMap.put(item.getImgUrl(), height);
} else {
height = heightMap.get(item.getImgUrl());
}
AppCompatImageView imageView = helper.getView(R.id.iv_item_pig_av_img);
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) imageView.getLayoutParams();
layoutParams.height = height;
imageView.setLayoutParams(layoutParams);
GlideApp.with(helper.itemView).load(item.getImgUrl()).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).into(imageView);
}
Aggregations