enighma
07/01/2023, 9:32 PMval drawable = context.packageManager.getDrawable(icon.resPackage, icon.resId, null)
I then use it using Accompanist:
remember(icon.resId) { DrawablePainter(drawable.mutate()) }
It doesn't start by default, and even when I call drawable.start()
it won't run, and drawable.isRunning
returns false.JustinBis
07/10/2023, 3:56 PMenighma
07/10/2023, 11:34 PMsetDrawable
that triggers it to start.
I wouldn't call it a solution as it's not anything I would put in production, but it points to where the issue might be. I was also able to load the vector as an AnimatedImageVector
but there's no playback controls from what I can see 😕enighma
07/10/2023, 11:37 PMDrawablePainter
and using rememberAnimatedVectorPainter
, neither worked.enighma
07/13/2023, 12:10 AMval vector = AnimatedImageVector.animatedVectorResource(resId)
var atEnd by remember { mutableStateOf(false) }
LaunchedEffect(vector) { atEnd = true } Icon( painter = rememberAnimatedVectorPainter(animatedImageVector = vector, atEnd = atEnd), contentDescription = null)
Since my resource was in another package I also had to override LocalContext with a ContextWrapper and using Resources
from that other package.