Closed aniluMango closed 2 years ago
The README
says you create a custom shimmer, the following example is provided:
fun Modifier.shimmer(
duration: Int
): Modifier = composed {
val shimmer = rememberShimmer(
shimmerBounds = ShimmerBounds.View,
theme = createCustomTheme(duration),
)
shimmer(customShimmer = shimmer)
}
If you want to tweak more parameters you can also add something like
fun Modifier.shimmer(
duration: Int,
delay: Int,
easing: Easing = LinearEasing,
repeatMode: RepeatMode = RepeatMode.Restart
): Modifier = composed {
val shimmer = rememberShimmer(
shimmerBounds = ShimmerBounds.View,
theme = defaultShimmerTheme.copy(
animationSpec = infiniteRepeatable(
animation = tween(
durationMillis = duration,
easing = easing,
delayMillis = delay,
),
repeatMode = repeatMode,
)
),
)
shimmer(customShimmer = shimmer)
}
Currently you can only change the duration of a shimmer. So the time it takes the shimmer to skim across your view. I was actually thinking of providing a way to really change the speed of the shimmer. So dp/s or a similar unit.
How can i change speed of shimmer effect ?