fix(nav): анимация иконки заметнее — медленнее и с отскоком (spring 0.36/240)
This commit is contained in:
@@ -3,7 +3,6 @@ package com.radiola.ui.navigation
|
|||||||
import androidx.compose.animation.AnimatedVisibility
|
import androidx.compose.animation.AnimatedVisibility
|
||||||
import androidx.compose.animation.animateColorAsState
|
import androidx.compose.animation.animateColorAsState
|
||||||
import androidx.compose.animation.core.Animatable
|
import androidx.compose.animation.core.Animatable
|
||||||
import androidx.compose.animation.core.Spring
|
|
||||||
import androidx.compose.animation.core.spring
|
import androidx.compose.animation.core.spring
|
||||||
import androidx.compose.animation.core.tween
|
import androidx.compose.animation.core.tween
|
||||||
import androidx.compose.animation.expandHorizontally
|
import androidx.compose.animation.expandHorizontally
|
||||||
@@ -152,8 +151,8 @@ private fun VerticalPillTab(
|
|||||||
val pop = remember { Animatable(1f) }
|
val pop = remember { Animatable(1f) }
|
||||||
LaunchedEffect(selected) {
|
LaunchedEffect(selected) {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
pop.snapTo(0.5f)
|
pop.snapTo(0.45f)
|
||||||
pop.animateTo(1f, spring(dampingRatio = Spring.DampingRatioMediumBouncy, stiffness = 620f))
|
pop.animateTo(1f, spring(dampingRatio = 0.36f, stiffness = 240f))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row(
|
Row(
|
||||||
@@ -201,8 +200,8 @@ private fun PillTab(
|
|||||||
val pop = remember { Animatable(1f) }
|
val pop = remember { Animatable(1f) }
|
||||||
LaunchedEffect(selected) {
|
LaunchedEffect(selected) {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
pop.snapTo(0.5f)
|
pop.snapTo(0.45f)
|
||||||
pop.animateTo(1f, spring(dampingRatio = Spring.DampingRatioMediumBouncy, stiffness = 620f))
|
pop.animateTo(1f, spring(dampingRatio = 0.36f, stiffness = 240f))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row(
|
Row(
|
||||||
|
|||||||
Reference in New Issue
Block a user