I have some problem: I want do clock arrow animation effect, but I can't find how I can set step count or step degree for my animation.
I'm using the following approach:
val rotation by infiniteTransition.animateFloat(
initialValue = 0f,
targetValue = 360f,
animationSpec = infiniteRepeatable(
animation = tween<Float>(
durationMillis = 1000,
easing = LinearEasing,
),
),
label = ""
)
Image(
painter = painterResource(id = imgRes),
modifier = Modifier
.size(imageSize)
.align(Alignment.CenterHorizontally)
.rotate(rotation),
contentDescription = "Image",
)
But the angle changes very "smoothly". I would like it to be jerky (like the second hand on a watch).
I'm trying to do something similar to a loading animation (like this animation).
Can you tell me how I can do this on Compose?
Thanks!
For now I decided to go with a mixed approach. I used xml layout inside compose func:
LoaderView:
image_view_loader.xml:
anum_loading_new.xml:
ic_loader.xml: