https://kotlinlang.org logo
#compose
Title
# compose
s

SrSouza

04/09/2020, 2:40 AM
Hi folks, I getting a unexpected behavior using Icon, the previous vector is being kept in the screen.
m

molikto

04/09/2020, 3:00 AM
Yes. I got this bug too, but forgot to file a bug report...
m

maciejciemiega

04/09/2020, 5:32 AM
z

Zach Klippenstein (he/him) [MOD]

04/09/2020, 2:44 PM
Oh I think I hit this too, thanks for filing!
👍 2
n

Nader Jawad

04/10/2020, 12:02 AM
Thanks for filing. Yes this is a known issue. As a workaround give the different vector drawable xml assets different name properties. The current logic right now is overly aggressive about caching if we think the contents are the same.
m

maciejciemiega

04/10/2020, 5:38 AM
Or move the
if
statement so the entire
Icon
changes, not only asset inside of it:
if (value) Icon(vectorResource(R.drawable.ic_add)) else Icon(vectorResource(R.drawable.ic_brightness_5))
2 Views