Closed bernaferrari closed 5 years ago
You get the right width after measuring.
but Glide works fine even without it
Glide does yes, but the image URL I request changes based on the size of the view: urlProvider.getPosterUrl(path, it.width)
Oooooh, that makes sense, thanks!!
Hi, I love your app, it has helped me a lot, but I am lazy to get the keys and test it on my phone. Most of DataBinding I learned by copying and modifying things from your app. Today, I implemented some new things and had a very weird issue: Glide displaying wrong images. After a lot of debugging, I found the doOnLayout wasn't being called when recycling. It works on some cases for me, but not on all of them, and my setup is similar to yours (mvrx, epoxy, databinding, etc). I removed it, and everything got fine.
So... It is not an "issue", but I also have nowhere else to ask and you are a bigger expert on databinding than me: why do you use the doOnLayout? Is it safe to remove it? Most tutorials don't include it, but you are a bigger expert than most people.
https://github.com/chrisbanes/tivi/blob/932713c01abdf3cf95ddda8d55865b864f63bd3a/app/src/main/java/app/tivi/ui/databinding/TiviBindingAdapters.kt#L34