Skip to content

Commit 3090d58

Browse files
committed
[Android]: Hide lobbies screen
1 parent ffb4f4f commit 3090d58

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

app/src/main/java/com/example/aftermathandroid/presentation/navigation/root/RooNavigation.kt

+4
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ class RootNavigation(navController: NavHostController) : Navigation(navControlle
3434
fun navigateToGame() {
3535
navController.navigate(RootRoute.Game.path())
3636
}
37+
38+
fun navigateToLobby() {
39+
navController.navigate(RootRoute.Lobby.path())
40+
}
3741
}

app/src/main/java/com/example/aftermathandroid/presentation/navigation/root/RootNavigator.kt

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import com.example.aftermathandroid.presentation.screens.auth.register.RegisterS
2121
import com.example.aftermathandroid.presentation.screens.dictionary.edit.EditDictionaryScreen
2222
import com.example.aftermathandroid.presentation.screens.dictionary.select.DictionarySelectScreen
2323
import com.example.aftermathandroid.presentation.screens.game.flow.GameFlowScreen
24+
import com.example.aftermathandroid.presentation.screens.game.lobby.LobbyScreen
2425
import com.example.aftermathandroid.presentation.screens.home.flow.HomeFlowScreen
2526
import com.example.aftermathandroid.presentation.screens.home.profile.ProfileScreen
2627

@@ -91,6 +92,9 @@ fun RootNavigator(
9192
) {
9293
GameFlowScreen()
9394
}
95+
composable(RootDestination.Lobby.path) {
96+
LobbyScreen()
97+
}
9498
}
9599
}
96100
}

app/src/main/java/com/example/aftermathandroid/presentation/navigation/root/RootRoute.kt

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ enum class RootDestination(val path: String) {
1010
EditDictionary("edit-dictionary"),
1111
SelectDictionary("select-dictionary"),
1212
Game("game"),
13+
Lobby("lobby")
1314
}
1415

1516
sealed class RootRoute(private val destination: RootDestination) : NavigationRoute {
@@ -25,4 +26,5 @@ sealed class RootRoute(private val destination: RootDestination) : NavigationRou
2526

2627
object SelectDictionary : RootRoute(RootDestination.SelectDictionary)
2728
object Game : RootRoute(RootDestination.Game)
29+
object Lobby : RootRoute(RootDestination.Lobby)
2830
}

app/src/main/java/com/example/aftermathandroid/presentation/screens/game/lobby_list/LobbyListScreen.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fun LobbyListScreen(
4848

4949
LaunchedEffect(Unit) {
5050
viewModel.lobbyCreatedFlow.collect {
51-
rootNavigation
51+
rootNavigation.navigateToLobby()
5252
}
5353
}
5454

app/src/main/java/com/example/aftermathandroid/presentation/screens/home/flow/HomeFlowScreen.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ fun HomeFlowScreen(
4343
icon = { Icon(imageVector = Icons.Outlined.PlayArrow, contentDescription = null) },
4444
label = { Text(text = stringResource(id = R.string.game)) },
4545
)
46-
NavigationBarItem(
46+
/* NavigationBarItem(
4747
selected = navigationState.value?.destination?.route == HomeRoute.Lobbies.path,
4848
onClick = { homeNavigation.navigateToLobbies() },
4949
icon = { Icon(imageVector = Icons.Outlined.Menu, contentDescription = null) },
5050
label = { Text(text = stringResource(id = R.string.lobbies)) },
51-
)
51+
)*/
5252
NavigationBarItem(
5353
selected = navigationState.value?.destination?.route == HomeRoute.Dictionaries.path,
5454
onClick = { homeNavigation.navigateToDictionaries() },

0 commit comments

Comments
 (0)