I\'m looking to adopt the Glide library in place of Universal Image Loader but I\'m running into a problem with regards to shared element transitions.
In my simple S
For those of you that are struggling with the SharedElementTransition using Glide I think I got a workaround that works, or at least it worked for me. In your second activity or fragment use this code:
postponeEnterTransition();
GlideApp.with(this)
.load(imageToLoad)
.listener(new RequestListener() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) {
return false;
}
@Override
public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) {
startPostponedEnterTransition();
return false;
}
})
.into(imageView);
If you are targeting API<21 use:
supportPostponeEnterTransition();
supportStartPostponedEnterTransition();
Hope that helps!