mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-18 16:01:44 +00:00
ui: improve home skeleton loading shimmer contrast and smoothness (#975)
This commit is contained in:
parent
fbedf613f5
commit
fda5812060
1 changed files with 6 additions and 4 deletions
|
|
@ -40,21 +40,23 @@ import com.nuvio.app.core.ui.rememberPosterCardStyleUiState
|
||||||
private fun rememberHomeSkeletonBrush(): Brush {
|
private fun rememberHomeSkeletonBrush(): Brush {
|
||||||
val shimmerColors = listOf(
|
val shimmerColors = listOf(
|
||||||
MaterialTheme.colorScheme.surface,
|
MaterialTheme.colorScheme.surface,
|
||||||
MaterialTheme.colorScheme.surface.copy(alpha = 0.5f),
|
MaterialTheme.colorScheme.surface,
|
||||||
|
MaterialTheme.colorScheme.onSurface.copy(alpha = 0.12f),
|
||||||
|
MaterialTheme.colorScheme.surface,
|
||||||
MaterialTheme.colorScheme.surface,
|
MaterialTheme.colorScheme.surface,
|
||||||
)
|
)
|
||||||
val transition = rememberInfiniteTransition()
|
val transition = rememberInfiniteTransition()
|
||||||
val translateAnim by transition.animateFloat(
|
val translateAnim by transition.animateFloat(
|
||||||
initialValue = 0f,
|
initialValue = 0f,
|
||||||
targetValue = 1000f,
|
targetValue = 1300f,
|
||||||
animationSpec = infiniteRepeatable(
|
animationSpec = infiniteRepeatable(
|
||||||
animation = tween(durationMillis = 1200, easing = LinearEasing),
|
animation = tween(durationMillis = 1500, easing = LinearEasing),
|
||||||
repeatMode = RepeatMode.Restart,
|
repeatMode = RepeatMode.Restart,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
val brush = Brush.linearGradient(
|
val brush = Brush.linearGradient(
|
||||||
colors = shimmerColors,
|
colors = shimmerColors,
|
||||||
start = Offset(translateAnim - 200f, 0f),
|
start = Offset(translateAnim - 600f, 0f),
|
||||||
end = Offset(translateAnim, 0f),
|
end = Offset(translateAnim, 0f),
|
||||||
)
|
)
|
||||||
return brush
|
return brush
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue