use of com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions 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.bitmap.BitmapTransitionOptions in project 91Pop by DanteAndroid.
the class Mm99Adapter method convert.
@Override
protected void convert(final BaseViewHolder helper, final Mm99 item) {
final ImageView imageView = helper.getView(R.id.iv_item_99_mm);
GlideApp.with(helper.itemView.getContext()).asBitmap().load(item.getImgUrl()).transition(new BitmapTransitionOptions().crossFade(300)).into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
imageView.setImageBitmap(resource);
int height;
if (!heightMap.containsKey(item.getImgUrl())) {
height = resource.getHeight() * width / item.getImgWidth();
heightMap.put(item.getImgUrl(), height);
} else {
height = heightMap.get(item.getImgUrl());
}
StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) helper.itemView.getLayoutParams();
layoutParams.height = height;
helper.itemView.setLayoutParams(layoutParams);
}
});
}
use of com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions in project Audient by komamj.
the class FavoriteDetailActivity method onPermissonGranted.
@Override
protected void onPermissonGranted() {
Favorite favorite = getIntent().getParcelableExtra(Constants.KEY_FAVORITE);
mToolbar.setTitle(favorite.favoriteName);
setSupportActionBar(mToolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_back);
}
GlideApp.with(this).asBitmap().transition(new BitmapTransitionOptions()).placeholder(R.drawable.ic_album).load(favorite.coverImageUrl).into(mAlbum);
mFab.setImageResource(R.drawable.ic_unfavorite);
FavoriteDetailFragment fragment = (FavoriteDetailFragment) getSupportFragmentManager().findFragmentById(R.id.content_main);
if (fragment == null) {
fragment = FavoriteDetailFragment.newInstance(favorite);
getSupportFragmentManager().beginTransaction().add(R.id.content_main, fragment).commit();
}
DaggerFavoriteDetailComponent.builder().audientRepositoryComponent(((AudientApplication) getApplication()).getRepositoryComponent()).favoriteDetailPresenterModule(new FavoriteDetailPresenterModule(fragment)).build().inject(this);
}
Aggregations