Skip to content

Instantly share code, notes, and snippets.

@cp-hardik-p
Created March 29, 2022 08:32
Show Gist options
  • Save cp-hardik-p/91d384d34ce459aefa6b1fcee1e7892d to your computer and use it in GitHub Desktop.
Save cp-hardik-p/91d384d34ce459aefa6b1fcee1e7892d to your computer and use it in GitHub Desktop.
@Composable
fun TwinCircleAnimation(infiniteTransition: InfiniteTransition) {
val twinCircleAnimation by infiniteTransition.animateFloat(
initialValue = 1f,
targetValue = 7f,
animationSpec = infiniteRepeatable(
animation = tween(1500, easing = FastOutSlowInEasing),
repeatMode = RepeatMode.Reverse
)
)
Row(
modifier = Modifier
.size(120.dp)
.padding(12.dp)
.clip(CircleShape)
.background(Red),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
) {
Box(
modifier = Modifier
.size(15.dp)
.scale(twinCircleAnimation)
.clip(CircleShape)
.background(White)
)
Spacer(modifier = Modifier.width(6.dp))
Box(
modifier = Modifier
.size(15.dp)
.scale(twinCircleAnimation)
.clip(CircleShape)
.background(White)
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment