Moved observeTintColor into bind method.

Changing tint color stopped working after rebind if
image url remained same because we are calling
view.closeAllSubscription() in bindView and didn't
call observeTintColor when imageUrl was same due to
if (isImageLoaded && newImageUrl == imageUrl) {
   return
}
in applyImage
This commit is contained in:
evgeek
2022-09-20 13:11:31 +03:00
parent 095b7a32fb
commit 859e4e00f7
@@ -87,6 +87,7 @@ internal class DivImageBinder @Inject constructor(
private fun DivImageView.applyImage(divView: Div2View, resolver: ExpressionResolver, div: DivImage) {
val newImageUrl = div.imageUrl.evaluate(resolver)
if (isImageLoaded && newImageUrl == imageUrl) {
observeTintColor(resolver, div.tintColor)
return
}
// Ignore high priority preview if image was previously loaded.