Hello team, Please I am trying to achieve this pro...
# android
g
Hello team, Please I am trying to achieve this progress animation in jetpack compose screen. Any pointer will be appreciated. Thanks
c
Just use lottie?
plus one 3
g
but can i control lottie animation for each state of scan because I need to change image color and circular color based on the result of the scan?
d
Well depending on how many state combinations you have, you can use multiple lotties
❤️ 1
e
https://rive.app/ is built to handle such multiple-state animations afaik
but if this is all, it doesn't look hard to achieve just with custom animation in Compose
g
I just need to animate to each image based on scan stages and change color of the image based on state ON or OFF
j
You can use a
ViewPager
and keep track of the state (currentPage). For the animation, center a
CircularProgressIndicator
and an
Icon
inside of it. It will not look exactly as in your image, but it will conform with Material Design guidelines. You should define a list of steps, in which each step has a "status" state, e.g. by using
StateFlow
or `mutableStateOf.`S each step corresponds to one page of the pager.
e
this is not necessarily the most efficient way to handle it, but if you divide up the responsibilities into different components, each becomes clearer. e.g. one for managing the state of each item, another for managing the transitions as the items move, and another for laying everything out
🙌 2
g
@ephemient thank you so much for your help and this mean alot to me and to everyone who has given me idea on how to go about this animation....thanks alot
j
Thank you, for the clarification 🙂