Created
March 29, 2022 08:32
-
-
Save cp-hardik-p/91d384d34ce459aefa6b1fcee1e7892d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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