Per doc: When a request completes successfully, the placeholder is replaced with the requested resource.
Actually it's not replaced, but instead it's show bellow the loaded image which causes expensive GPU overdraws, so with placeholder our recyclerview is jerky on low end devices.
GlideApp.with(context)
.load(link)
.diskCacheStrategy(NONE)
.placeholder(R.color.placeholder)
.error(R.color.colorAccent)
.centerCrop()
.transition(withCrossFade())
.into(imageView);
After some research I realized that if I pass
DrawableTransitionOptions drawableTransitionOptions = new DrawableTransitionOptions().
crossFade(new DrawableCrossFadeFactory.Builder().
setCrossFadeEnabled(true)
.build());
to .transition() instead of withCrossFade(), behaviour is different and placeholder is removed after cross fade is finished.
Why default behaviour is not like that?
Is it safe to assume that with code like this performance will be better because of less overdraws or removing placeholder is more expensive?
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.
See http://bumptech.github.io/glide/doc/transitions.html#cross-fading-with-placeholders-and-transparent-images
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.
Most helpful comment
After some research I realized that if I pass
to
.transition()instead ofwithCrossFade(), behaviour is different and placeholder is removed after cross fade is finished.Why default behaviour is not like that?
Is it safe to assume that with code like this performance will be better because of less overdraws or removing placeholder is more expensive?