diff --git a/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/MainActivity.kt b/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/MainActivity.kt index 2d71d70..4db5c7e 100644 --- a/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/MainActivity.kt +++ b/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/MainActivity.kt @@ -10,15 +10,16 @@ import androidx.compose.material.BottomNavigationItem import androidx.compose.material.Icon import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Home +import androidx.compose.material3.CenterAlignedTopAppBar import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Scaffold import androidx.compose.material3.Surface import androidx.compose.material3.Text -import androidx.compose.material3.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.tooling.preview.Preview import androidx.navigation.NavHostController import androidx.navigation.compose.NavHost @@ -68,6 +69,8 @@ fun MainScreen() { modifier = Modifier.padding(padding) ) { composable(HOME) { HomeScreen(padding) } + composable(MODIFY_SET) { ModifySetScreen(padding, navController) } + composable(PLAY) { PlayScreen(padding, navController) } } } } @@ -75,9 +78,9 @@ fun MainScreen() { @OptIn(ExperimentalMaterial3Api::class) @Composable fun TopBar() = - TopAppBar(title = { + CenterAlignedTopAppBar(title = { Text( - "Projet", + text = LocalContext.current.getString(R.string.app_name), style = MaterialTheme.typography.displayMedium ) }) @@ -88,7 +91,15 @@ fun BottomBar(navController: NavHostController) = val navBackStackEntry by navController.currentBackStackEntryAsState() val currentRoute = navBackStackEntry?.destination?.route - BottomNavigationItem(selected = currentRoute == HOME, onClick = { - navController.navigate(HOME) { launchSingleTop = true } - }, icon = { Icon(Icons.Default.Home, "Page principale") }) + BottomNavigationItem( + selected = currentRoute == HOME, + onClick = { + navController.navigate(HOME) { launchSingleTop = true } + }, + icon = { + Icon( + imageVector = Icons.Default.Home, + contentDescription = LocalContext.current.getString(R.string.home_button) + ) + }) } diff --git a/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/ModifySetScreen.kt b/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/ModifySetScreen.kt index e2a1658..f4bf837 100644 --- a/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/ModifySetScreen.kt +++ b/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/ModifySetScreen.kt @@ -2,8 +2,9 @@ package fr.uparis.diamantkennel.memorisationapplication import androidx.compose.foundation.layout.PaddingValues import androidx.compose.runtime.Composable +import androidx.navigation.NavController @Composable -fun ModifySetScreen(padding: PaddingValues) { +fun ModifySetScreen(padding: PaddingValues, navController: NavController) { } diff --git a/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/PlayScreen.kt b/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/PlayScreen.kt index 3615eb9..c1da450 100644 --- a/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/PlayScreen.kt +++ b/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/PlayScreen.kt @@ -2,8 +2,9 @@ package fr.uparis.diamantkennel.memorisationapplication import androidx.compose.foundation.layout.PaddingValues import androidx.compose.runtime.Composable +import androidx.navigation.NavController @Composable -fun PlayScreen(padding: PaddingValues) { +fun PlayScreen(padding: PaddingValues, navController: NavController) { } diff --git a/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/Routes.kt b/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/Routes.kt index 049ccc9..7b1262d 100644 --- a/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/Routes.kt +++ b/app/src/main/java/fr/uparis/diamantkennel/memorisationapplication/Routes.kt @@ -1,3 +1,5 @@ package fr.uparis.diamantkennel.memorisationapplication const val HOME = "home" +const val MODIFY_SET = "modify_set" +const val PLAY = "play" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e0b33b0..f14896f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ - MemorisationApplication + Memorisation + Page principale \ No newline at end of file