Open kenyee opened 3 years ago
hmm...could be related to the use of a gridlayout and constraintlayout fit sizing...image width/height is zero in the viewholder bind...
If I do this, it semi works but then you have a race condition w/ Coil so sometimes the images don't load properly and only the blurhash remains :-(
blurHashHandler.execute(it.blurHash, 100, 100) { bitmapDrawable ->
image.setImageDrawable(bitmapDrawable)
}
image.load(it.imageUrls.small) {
crossfade(true)
}
this seems to work:
image.load(it.imageUrls.small) {
crossfade(true)
blurPlaceHolder(it.blurHash, blurImageSizePx, blurImageSizePx, blurHash = blurHashHandler)
{ coilImageBuilder ->
coilImageBuilder.build()
}
}
but it's fairly slow generating the blur hash so the background stays white for a while
Calling it with:
blurHashHandler is initialized in the fragment like so:
The images pop into view w/o showing the blurhash placeholder.