With glide v4 default cross fade animation removed. I updated my Glide version to 4 and I want to set a default cross fade animation, not to set for every image load request.
I tried to do it in AppGlideModule extended class which name is "Generated API" at setDefaultTransitionOptions
but I failed.
How can I set default cross fade animation in Glide v4?
I did it with this code:
builder.setDefaultTransitionOptions(Drawable.class, DrawableTransitionOptions.withCrossFade());
This works for me:
Glide.with(context).load(image).transition(DrawableTransitionOptions.withCrossFade()).into(view);
You can use this way, it is simple you can also add duration to your transition
Uri image= Uri.parse(url_of_the_image);
Glide.with(context)
.load(image)
.transition(DrawableTransitionOptions.withCrossFade(duration_in_ms))
.into(imageView);`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With