|
|
|
@ -16,6 +16,9 @@ import androidx.activity.ComponentActivity
|
|
|
|
|
import androidx.activity.compose.setContent
|
|
|
|
|
import androidx.activity.result.ActivityResultLauncher
|
|
|
|
|
import androidx.activity.result.contract.ActivityResultContract
|
|
|
|
|
import androidx.compose.animation.core.tween
|
|
|
|
|
import androidx.compose.animation.slideInHorizontally
|
|
|
|
|
import androidx.compose.animation.slideOutHorizontally
|
|
|
|
|
import androidx.lifecycle.lifecycleScope
|
|
|
|
|
import androidx.navigation.NavType
|
|
|
|
|
import androidx.navigation.compose.NavHost
|
|
|
|
@ -69,7 +72,21 @@ class MainActivity : ComponentActivity() {
|
|
|
|
|
setContent {
|
|
|
|
|
AppTheme {
|
|
|
|
|
val navController = rememberNavController()
|
|
|
|
|
NavHost(navController = navController, startDestination = "main") {
|
|
|
|
|
NavHost(
|
|
|
|
|
navController = navController,
|
|
|
|
|
startDestination = "main",
|
|
|
|
|
enterTransition = {
|
|
|
|
|
slideInHorizontally(animationSpec = tween(150), initialOffsetX = { it })
|
|
|
|
|
},
|
|
|
|
|
exitTransition = {
|
|
|
|
|
slideOutHorizontally(animationSpec = tween(150), targetOffsetX = { -it })
|
|
|
|
|
},
|
|
|
|
|
popEnterTransition = {
|
|
|
|
|
slideInHorizontally(animationSpec = tween(150), initialOffsetX = { -it })
|
|
|
|
|
},
|
|
|
|
|
popExitTransition = {
|
|
|
|
|
slideOutHorizontally(animationSpec = tween(150), targetOffsetX = { it })
|
|
|
|
|
}) {
|
|
|
|
|
val mainViewNav =
|
|
|
|
|
MainViewNavigation(
|
|
|
|
|
onNavigateToSettings = { navController.navigate("settings") },
|
|
|
|
@ -132,7 +149,9 @@ class MainActivity : ComponentActivity() {
|
|
|
|
|
composable("userSwitcher") {
|
|
|
|
|
UserSwitcherView(
|
|
|
|
|
nav = backNav,
|
|
|
|
|
onNavigateHome = { navController.popBackStack(route = "main", inclusive = false) })
|
|
|
|
|
onNavigateHome = {
|
|
|
|
|
navController.popBackStack(route = "main", inclusive = false)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
composable("permissions") {
|
|
|
|
|
PermissionsView(nav = backNav, openApplicationSettings = ::openApplicationSettings)
|
|
|
|
|