ktlint: Format all extensions

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2025-12-30 15:53:26 +08:00
parent a084a57619
commit 13c9b946af
11 changed files with 143 additions and 149 deletions

View File

@@ -28,38 +28,36 @@ import androidx.compose.ui.unit.IntSize
* Modifier for composable to play shimmer animation
* @param toShow Whether to play shimmer animation
*/
fun Modifier.shimmer(toShow: Boolean): Modifier {
return composed {
if (toShow) {
val shimmerColors = listOf(
Color.LightGray.copy(alpha = 0.6f),
Color.LightGray.copy(alpha = 0.2f),
Color.LightGray.copy(alpha = 0.6f)
)
fun Modifier.shimmer(toShow: Boolean): Modifier = composed {
if (toShow) {
val shimmerColors = listOf(
Color.LightGray.copy(alpha = 0.6f),
Color.LightGray.copy(alpha = 0.2f),
Color.LightGray.copy(alpha = 0.6f)
)
var size by remember { mutableStateOf(IntSize.Zero) }
var size by remember { mutableStateOf(IntSize.Zero) }
val transition = rememberInfiniteTransition()
val transitionAnimation = transition.animateFloat(
initialValue = 0f,
targetValue = 1000f,
animationSpec = infiniteRepeatable(
animation = tween(
durationMillis = 1000,
easing = FastOutSlowInEasing
),
repeatMode = RepeatMode.Reverse
)
val transition = rememberInfiniteTransition()
val transitionAnimation = transition.animateFloat(
initialValue = 0f,
targetValue = 1000f,
animationSpec = infiniteRepeatable(
animation = tween(
durationMillis = 1000,
easing = FastOutSlowInEasing
),
repeatMode = RepeatMode.Reverse
)
background(
brush = Brush.linearGradient(
colors = shimmerColors,
start = Offset.Zero,
end = Offset(x = transitionAnimation.value, y = transitionAnimation.value)
)
).onGloballyPositioned { size = it.size }
} else {
Modifier
}
)
background(
brush = Brush.linearGradient(
colors = shimmerColors,
start = Offset.Zero,
end = Offset(x = transitionAnimation.value, y = transitionAnimation.value)
)
).onGloballyPositioned { size = it.size }
} else {
Modifier
}
}