I have a motion layout with this layoutDescription: app:layoutDescription=\"@xml/scene\"
scene.xml
We can simply do like this motion_layout.transitionToEnd()
But on Activity resumed, It'll start our animation so fast that we may miss the few or the whole animation. so I would suggest to add some delay like.
GlobalScope.launch (Dispatchers.IO){
delay(1000)
withContext(Dispatchers.Main){
motion_layout.transitionToEnd()
}
}
Also you'll need to add Coroutines dependency if not added.
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'