Refactor(Animation): Optimize navigation switch animation
Optimize AboutNavigation and LibrariesNavigation switch animation
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package top.fatweb.oxygen.toolbox.navigation
|
||||
|
||||
import androidx.compose.animation.scaleIn
|
||||
import androidx.compose.animation.slideOutVertically
|
||||
import androidx.compose.animation.slideInHorizontally
|
||||
import androidx.compose.animation.slideOutHorizontally
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.NavGraphBuilder
|
||||
import androidx.navigation.NavOptions
|
||||
@@ -20,16 +20,11 @@ fun NavGraphBuilder.aboutScreen(
|
||||
composable(
|
||||
route = ABOUT_ROUTE,
|
||||
enterTransition = {
|
||||
scaleIn()
|
||||
},
|
||||
exitTransition = {
|
||||
slideOutVertically { it }
|
||||
},
|
||||
popEnterTransition = {
|
||||
scaleIn()
|
||||
slideInHorizontally(initialOffsetX = { fullWidth -> fullWidth })
|
||||
},
|
||||
popEnterTransition = null,
|
||||
popExitTransition = {
|
||||
slideOutVertically { it }
|
||||
slideOutHorizontally(targetOffsetX = { fullWidth -> fullWidth })
|
||||
}
|
||||
) {
|
||||
AboutRoute(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package top.fatweb.oxygen.toolbox.navigation
|
||||
|
||||
import androidx.compose.animation.scaleIn
|
||||
import androidx.compose.animation.scaleOut
|
||||
import androidx.compose.animation.slideInHorizontally
|
||||
import androidx.compose.animation.slideOutHorizontally
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.NavGraphBuilder
|
||||
import androidx.navigation.NavOptions
|
||||
@@ -19,16 +19,11 @@ fun NavGraphBuilder.librariesScreen(
|
||||
composable(
|
||||
route = LIBRARIES_ROUTE,
|
||||
enterTransition = {
|
||||
scaleIn()
|
||||
},
|
||||
exitTransition = {
|
||||
scaleOut()
|
||||
},
|
||||
popEnterTransition = {
|
||||
scaleIn()
|
||||
slideInHorizontally(initialOffsetX = { fullWidth -> fullWidth })
|
||||
},
|
||||
popEnterTransition = null,
|
||||
popExitTransition = {
|
||||
scaleOut()
|
||||
slideOutHorizontally(targetOffsetX = { fullWidth -> fullWidth })
|
||||
}
|
||||
) {
|
||||
LibrariesRoute(onBackClick = onBackClick)
|
||||
|
||||
Reference in New Issue
Block a user