ursus
05/23/2024, 1:50 PMval id = if (isSelected) R.drawable.ic_btncheckboxon else R.drawable.ic_btncheckboxoff <--------------------
Image(
modifier = Modifier
.size(20.dp, 20.dp)
.clickable { onClick() },
painter = painterResource(id = id),
contentDescription = null
)
how can I animate changing image resource?Michael Krussel
05/23/2024, 2:10 PMephemient
05/23/2024, 2:12 PMAnimatedContent
for a simple transition. or convert both to a single AnimatedVectorDrawable wrapped in accompanist painter if you want to morph pathsursus
05/23/2024, 3:51 PMImage
composables?Zach Klippenstein (he/him) [MOD]
05/23/2024, 5:22 PMCrossfade
is an option too, it’s like a more limited AnimatedContent
ursus
05/23/2024, 5:23 PMZach Klippenstein (he/him) [MOD]
05/23/2024, 5:25 PMImage
can’t do any animations itself