File tree 5 files changed +13
-3
lines changed
app/src/main/java/com/example/aftermathandroid/presentation
5 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -34,4 +34,8 @@ class RootNavigation(navController: NavHostController) : Navigation(navControlle
34
34
fun navigateToGame () {
35
35
navController.navigate(RootRoute .Game .path())
36
36
}
37
+
38
+ fun navigateToLobby () {
39
+ navController.navigate(RootRoute .Lobby .path())
40
+ }
37
41
}
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import com.example.aftermathandroid.presentation.screens.auth.register.RegisterS
21
21
import com.example.aftermathandroid.presentation.screens.dictionary.edit.EditDictionaryScreen
22
22
import com.example.aftermathandroid.presentation.screens.dictionary.select.DictionarySelectScreen
23
23
import com.example.aftermathandroid.presentation.screens.game.flow.GameFlowScreen
24
+ import com.example.aftermathandroid.presentation.screens.game.lobby.LobbyScreen
24
25
import com.example.aftermathandroid.presentation.screens.home.flow.HomeFlowScreen
25
26
import com.example.aftermathandroid.presentation.screens.home.profile.ProfileScreen
26
27
@@ -91,6 +92,9 @@ fun RootNavigator(
91
92
) {
92
93
GameFlowScreen ()
93
94
}
95
+ composable(RootDestination .Lobby .path) {
96
+ LobbyScreen ()
97
+ }
94
98
}
95
99
}
96
100
}
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ enum class RootDestination(val path: String) {
10
10
EditDictionary (" edit-dictionary" ),
11
11
SelectDictionary (" select-dictionary" ),
12
12
Game (" game" ),
13
+ Lobby (" lobby" )
13
14
}
14
15
15
16
sealed class RootRoute (private val destination : RootDestination ) : NavigationRoute {
@@ -25,4 +26,5 @@ sealed class RootRoute(private val destination: RootDestination) : NavigationRou
25
26
26
27
object SelectDictionary : RootRoute(RootDestination .SelectDictionary )
27
28
object Game : RootRoute(RootDestination .Game )
29
+ object Lobby : RootRoute(RootDestination .Lobby )
28
30
}
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ fun LobbyListScreen(
48
48
49
49
LaunchedEffect (Unit ) {
50
50
viewModel.lobbyCreatedFlow.collect {
51
- rootNavigation
51
+ rootNavigation.navigateToLobby()
52
52
}
53
53
}
54
54
Original file line number Diff line number Diff line change @@ -43,12 +43,12 @@ fun HomeFlowScreen(
43
43
icon = { Icon (imageVector = Icons .Outlined .PlayArrow , contentDescription = null ) },
44
44
label = { Text (text = stringResource(id = R .string.game)) },
45
45
)
46
- NavigationBarItem (
46
+ /* NavigationBarItem(
47
47
selected = navigationState.value?.destination?.route == HomeRoute.Lobbies.path,
48
48
onClick = { homeNavigation.navigateToLobbies() },
49
49
icon = { Icon(imageVector = Icons.Outlined.Menu, contentDescription = null) },
50
50
label = { Text(text = stringResource(id = R.string.lobbies)) },
51
- )
51
+ )*/
52
52
NavigationBarItem (
53
53
selected = navigationState.value?.destination?.route == HomeRoute .Dictionaries .path,
54
54
onClick = { homeNavigation.navigateToDictionaries() },
You can’t perform that action at this time.
0 commit comments