mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-03-06 22:36:08 +00:00
android: update transitions
This commit is contained in:
@@ -34,6 +34,8 @@ import androidx.activity.compose.setContent
|
|||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.compose.animation.core.Spring
|
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.FastOutSlowInEasing
|
||||||
import androidx.compose.animation.scaleIn
|
import androidx.compose.animation.scaleIn
|
||||||
import androidx.compose.animation.scaleOut
|
import androidx.compose.animation.scaleOut
|
||||||
import androidx.compose.animation.slideInHorizontally
|
import androidx.compose.animation.slideInHorizontally
|
||||||
@@ -72,6 +74,9 @@ import me.kavishdevar.aln.services.ServiceManager
|
|||||||
import me.kavishdevar.aln.ui.theme.ALNTheme
|
import me.kavishdevar.aln.ui.theme.ALNTheme
|
||||||
import me.kavishdevar.aln.utils.AirPodsNotifications
|
import me.kavishdevar.aln.utils.AirPodsNotifications
|
||||||
import me.kavishdevar.aln.utils.CrossDevice
|
import me.kavishdevar.aln.utils.CrossDevice
|
||||||
|
import androidx.compose.animation.core.LinearEasing
|
||||||
|
import androidx.compose.animation.fadeIn
|
||||||
|
import androidx.compose.animation.fadeOut
|
||||||
|
|
||||||
lateinit var serviceConnection: ServiceConnection
|
lateinit var serviceConnection: ServiceConnection
|
||||||
lateinit var connectionStatusReceiver: BroadcastReceiver
|
lateinit var connectionStatusReceiver: BroadcastReceiver
|
||||||
@@ -170,62 +175,26 @@ fun Main() {
|
|||||||
enterTransition = {
|
enterTransition = {
|
||||||
slideInHorizontally(
|
slideInHorizontally(
|
||||||
initialOffsetX = { it },
|
initialOffsetX = { it },
|
||||||
animationSpec = spring(
|
animationSpec = tween(durationMillis = 300)
|
||||||
dampingRatio = Spring.DampingRatioLowBouncy,
|
) + fadeIn(animationSpec = tween(durationMillis = 300))
|
||||||
stiffness = Spring.StiffnessLow
|
|
||||||
)
|
|
||||||
) + scaleIn(
|
|
||||||
initialScale = 0.85f,
|
|
||||||
animationSpec = spring(
|
|
||||||
dampingRatio = Spring.DampingRatioLowBouncy,
|
|
||||||
stiffness = Spring.StiffnessLow
|
|
||||||
)
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
exitTransition = {
|
exitTransition = {
|
||||||
slideOutHorizontally(
|
slideOutHorizontally(
|
||||||
targetOffsetX = { -it },
|
targetOffsetX = { -it/4 },
|
||||||
animationSpec = spring(
|
animationSpec = tween(durationMillis = 300)
|
||||||
dampingRatio = Spring.DampingRatioLowBouncy,
|
) + fadeOut(animationSpec = tween(durationMillis = 150))
|
||||||
stiffness = Spring.StiffnessLow
|
|
||||||
)
|
|
||||||
) + scaleOut(
|
|
||||||
targetScale = 0.85f,
|
|
||||||
animationSpec = spring(
|
|
||||||
dampingRatio = Spring.DampingRatioLowBouncy,
|
|
||||||
stiffness = Spring.StiffnessLow
|
|
||||||
)
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
popEnterTransition = {
|
popEnterTransition = {
|
||||||
slideInHorizontally(
|
slideInHorizontally(
|
||||||
initialOffsetX = { -it },
|
initialOffsetX = { -it/4 },
|
||||||
animationSpec = spring(
|
animationSpec = tween(durationMillis = 300)
|
||||||
dampingRatio = Spring.DampingRatioLowBouncy,
|
) + fadeIn(animationSpec = tween(durationMillis = 300))
|
||||||
stiffness = Spring.StiffnessLow
|
|
||||||
)
|
|
||||||
) + scaleIn(
|
|
||||||
initialScale = 0.85f,
|
|
||||||
animationSpec = spring(
|
|
||||||
dampingRatio = Spring.DampingRatioLowBouncy,
|
|
||||||
stiffness = Spring.StiffnessLow
|
|
||||||
)
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
popExitTransition = {
|
popExitTransition = {
|
||||||
slideOutHorizontally(
|
slideOutHorizontally(
|
||||||
targetOffsetX = { it },
|
targetOffsetX = { it },
|
||||||
animationSpec = spring(
|
animationSpec = tween(durationMillis = 300)
|
||||||
dampingRatio = Spring.DampingRatioLowBouncy,
|
) + fadeOut(animationSpec = tween(durationMillis = 150))
|
||||||
stiffness = Spring.StiffnessLow
|
|
||||||
)
|
|
||||||
) + scaleOut(
|
|
||||||
targetScale = 0.85f,
|
|
||||||
animationSpec = spring(
|
|
||||||
dampingRatio = Spring.DampingRatioLowBouncy,
|
|
||||||
stiffness = Spring.StiffnessLow
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
composable("settings") {
|
composable("settings") {
|
||||||
|
|||||||
Reference in New Issue
Block a user