I’m having an issue with Vector Images overlap dur...
# compose
b
I’m having an issue with Vector Images overlap during recomposition.
Copy code
val savedIcon = state { post.saved.icon }
Image(
            modifier = Modifier.weight(1f) + Modifier.clickable(onClick = {
                post.toggleSave()
                savedIcon.value = post.saved.icon
            }),
            asset = vectorResource(id = savedIcon.value)
        )
On toggle, the icon resource should swap. It works the first time (outline to solid) but on the second time the outline shows on top (shown in the pictures below). Any reason why this is happening?
I should note that scrolling the item off screen and back will show the correct icon (I assume since it redraws the entire layout)
l
This might be the same as: issuetracker.google.com/issues/152712588 If you change the name of the icons
(.copy(name = )
does it still not work properly?
b
Oh yeah, that totally works
Thanks
I’ll keep my eye on that bug