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
|
package top.fatweb.oxygen.toolbox.navigation
|
||||||
|
|
||||||
import androidx.compose.animation.scaleIn
|
import androidx.compose.animation.slideInHorizontally
|
||||||
import androidx.compose.animation.slideOutVertically
|
import androidx.compose.animation.slideOutHorizontally
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
import androidx.navigation.NavGraphBuilder
|
import androidx.navigation.NavGraphBuilder
|
||||||
import androidx.navigation.NavOptions
|
import androidx.navigation.NavOptions
|
||||||
@@ -20,16 +20,11 @@ fun NavGraphBuilder.aboutScreen(
|
|||||||
composable(
|
composable(
|
||||||
route = ABOUT_ROUTE,
|
route = ABOUT_ROUTE,
|
||||||
enterTransition = {
|
enterTransition = {
|
||||||
scaleIn()
|
slideInHorizontally(initialOffsetX = { fullWidth -> fullWidth })
|
||||||
},
|
|
||||||
exitTransition = {
|
|
||||||
slideOutVertically { it }
|
|
||||||
},
|
|
||||||
popEnterTransition = {
|
|
||||||
scaleIn()
|
|
||||||
},
|
},
|
||||||
|
popEnterTransition = null,
|
||||||
popExitTransition = {
|
popExitTransition = {
|
||||||
slideOutVertically { it }
|
slideOutHorizontally(targetOffsetX = { fullWidth -> fullWidth })
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
AboutRoute(
|
AboutRoute(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package top.fatweb.oxygen.toolbox.navigation
|
package top.fatweb.oxygen.toolbox.navigation
|
||||||
|
|
||||||
import androidx.compose.animation.scaleIn
|
import androidx.compose.animation.slideInHorizontally
|
||||||
import androidx.compose.animation.scaleOut
|
import androidx.compose.animation.slideOutHorizontally
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
import androidx.navigation.NavGraphBuilder
|
import androidx.navigation.NavGraphBuilder
|
||||||
import androidx.navigation.NavOptions
|
import androidx.navigation.NavOptions
|
||||||
@@ -19,16 +19,11 @@ fun NavGraphBuilder.librariesScreen(
|
|||||||
composable(
|
composable(
|
||||||
route = LIBRARIES_ROUTE,
|
route = LIBRARIES_ROUTE,
|
||||||
enterTransition = {
|
enterTransition = {
|
||||||
scaleIn()
|
slideInHorizontally(initialOffsetX = { fullWidth -> fullWidth })
|
||||||
},
|
|
||||||
exitTransition = {
|
|
||||||
scaleOut()
|
|
||||||
},
|
|
||||||
popEnterTransition = {
|
|
||||||
scaleIn()
|
|
||||||
},
|
},
|
||||||
|
popEnterTransition = null,
|
||||||
popExitTransition = {
|
popExitTransition = {
|
||||||
scaleOut()
|
slideOutHorizontally(targetOffsetX = { fullWidth -> fullWidth })
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
LibrariesRoute(onBackClick = onBackClick)
|
LibrariesRoute(onBackClick = onBackClick)
|
||||||
|
|||||||
Reference in New Issue
Block a user