mmaillot
03/28/2021, 1:29 PMImage
to move to a specific point ? I have an image at the top of my screen and an another image at the bottom. I want to translate the top image to the bottom. I’m starting with animation and I’m looking if there is an easy way to do that. I found the translateY
method but how to get the dp between the top image and the bottom image ?Olivier Patry
03/28/2021, 3:11 PMmmaillot
03/28/2021, 3:52 PMTash
03/28/2021, 5:48 PMval animatedDeltaX = Animatable(0f) // animate to target deltaX
val animatedDeltaY = Animatable(0f) // animate to target deltaY
Image(
modifier = Modifier.graphicsLayer {
translateX = animatedDeltaX.value
translateY = animatedDeltaY.value
}
)
mmaillot
03/29/2021, 9:17 AM