-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
77 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
android/app/src/main/java/by/eapp/musicroom/navigation/NavHost.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package by.eapp.musicroom.navigation | ||
|
||
|
||
import RegistrationScreen | ||
import androidx.compose.animation.AnimatedContentScope | ||
|
||
import androidx.compose.animation.AnimatedContentTransitionScope | ||
import androidx.compose.animation.core.FastOutLinearInEasing | ||
import androidx.compose.animation.core.LinearOutSlowInEasing | ||
import androidx.compose.animation.core.tween | ||
import androidx.compose.runtime.Composable | ||
import androidx.navigation.NavHostController | ||
import androidx.navigation.compose.NavHost | ||
import androidx.navigation.compose.composable | ||
import by.eapp.musicroom.screens.login.LoginScreen | ||
|
||
@Composable | ||
fun NavHostController( | ||
navController: NavHostController, | ||
) { | ||
NavHost( | ||
navController = navController, | ||
startDestination = Screens.RegistrationScreen.route | ||
) { | ||
composable( | ||
route = Screens.RegistrationScreen.route, | ||
enterTransition = { | ||
slideIntoContainer( | ||
AnimatedContentTransitionScope.SlideDirection.Left, | ||
animationSpec = tween( | ||
durationMillis = 500, | ||
easing = LinearOutSlowInEasing | ||
) | ||
) | ||
}, | ||
|
||
) { | ||
RegistrationScreen(navController = navController) | ||
} | ||
composable( | ||
route = Screens.LoginScreen.route, | ||
enterTransition = { | ||
slideIntoContainer( | ||
AnimatedContentTransitionScope.SlideDirection.Right, | ||
animationSpec = tween( | ||
durationMillis = 500, | ||
easing = LinearOutSlowInEasing | ||
) | ||
) | ||
}, | ||
|
||
) { | ||
LoginScreen(navController = navController) | ||
} | ||
composable(route = Screens.MainScreen.route) { | ||
// MainScreen(navController = navController) | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
android/app/src/main/java/by/eapp/musicroom/navigation/Screens.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package by.eapp.musicroom.navigation | ||
|
||
sealed class Screens( | ||
val route: String | ||
) { | ||
data object RegistrationScreen: Screens("registration") | ||
data object LoginScreen: Screens("login") | ||
data object MainScreen: Screens("main") | ||
} |