Add dummy stats screen to bottom navigation
This commit is contained in:
@@ -33,6 +33,7 @@ import eu.gaudian.translator.view.settings.DictionaryOptionsScreen
|
|||||||
import eu.gaudian.translator.view.settings.SettingsRoutes
|
import eu.gaudian.translator.view.settings.SettingsRoutes
|
||||||
import eu.gaudian.translator.view.settings.TranslationSettingsScreen
|
import eu.gaudian.translator.view.settings.TranslationSettingsScreen
|
||||||
import eu.gaudian.translator.view.settings.settingsGraph
|
import eu.gaudian.translator.view.settings.settingsGraph
|
||||||
|
import eu.gaudian.translator.view.stats.StatsScreen
|
||||||
import eu.gaudian.translator.view.translation.TranslationScreen
|
import eu.gaudian.translator.view.translation.TranslationScreen
|
||||||
import eu.gaudian.translator.view.vocabulary.CategoryDetailScreen
|
import eu.gaudian.translator.view.vocabulary.CategoryDetailScreen
|
||||||
import eu.gaudian.translator.view.vocabulary.CategoryListScreen
|
import eu.gaudian.translator.view.vocabulary.CategoryListScreen
|
||||||
@@ -59,6 +60,7 @@ fun AppNavHost(
|
|||||||
// 1. Define your Main Tab "Leaf" Routes (the actual start destinations of your graphs)
|
// 1. Define your Main Tab "Leaf" Routes (the actual start destinations of your graphs)
|
||||||
val mainTabRoutes = setOf(
|
val mainTabRoutes = setOf(
|
||||||
Screen.Home.route,
|
Screen.Home.route,
|
||||||
|
Screen.Stats.route,
|
||||||
Screen.Translation.route,
|
Screen.Translation.route,
|
||||||
Screen.Vocabulary.route,
|
Screen.Vocabulary.route,
|
||||||
Screen.Dictionary.route,
|
Screen.Dictionary.route,
|
||||||
@@ -125,6 +127,10 @@ fun AppNavHost(
|
|||||||
HomeScreen(navController = navController)
|
HomeScreen(navController = navController)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
composable(Screen.Stats.route) {
|
||||||
|
StatsScreen(navController = navController)
|
||||||
|
}
|
||||||
|
|
||||||
// Define all other navigation graphs at the same top level.
|
// Define all other navigation graphs at the same top level.
|
||||||
homeGraph(navController)
|
homeGraph(navController)
|
||||||
translationGraph(navController)
|
translationGraph(navController)
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ sealed class Screen(
|
|||||||
val unselectedIcon: ImageVector
|
val unselectedIcon: ImageVector
|
||||||
) {
|
) {
|
||||||
object Home : Screen("home", R.string.label_home, AppIcons.Home, AppIcons.Home)
|
object Home : Screen("home", R.string.label_home, AppIcons.Home, AppIcons.Home)
|
||||||
|
object Stats : Screen("stats", R.string.label_stats, AppIcons.Statistics, AppIcons.Statistics)
|
||||||
object Translation : Screen("translation", R.string.label_translation, AppIcons.TranslateFilled, AppIcons.TranslateOutlined)
|
object Translation : Screen("translation", R.string.label_translation, AppIcons.TranslateFilled, AppIcons.TranslateOutlined)
|
||||||
object Vocabulary : Screen("vocabulary", R.string.label_vocabulary, AppIcons.VocabularyFilled, AppIcons.VocabularyOutlined)
|
object Vocabulary : Screen("vocabulary", R.string.label_vocabulary, AppIcons.VocabularyFilled, AppIcons.VocabularyOutlined)
|
||||||
object Settings : Screen("settings", R.string.title_settings, AppIcons.SettingsFilled, AppIcons.SettingsOutlined)
|
object Settings : Screen("settings", R.string.title_settings, AppIcons.SettingsFilled, AppIcons.SettingsOutlined)
|
||||||
@@ -72,7 +73,7 @@ sealed class Screen(
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun getAllScreens(showExperimental: Boolean = false): List<Screen> {
|
fun getAllScreens(showExperimental: Boolean = false): List<Screen> {
|
||||||
return listOf(Home, Vocabulary)
|
return listOf(Home, Vocabulary, Stats)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getMoreMenuItems(showExperimental: Boolean = false): List<Screen> {
|
fun getMoreMenuItems(showExperimental: Boolean = false): List<Screen> {
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package eu.gaudian.translator.view.stats
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.navigation.NavHostController
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun StatsScreen(
|
||||||
|
navController: NavHostController,
|
||||||
|
modifier: Modifier = Modifier
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = modifier.fillMaxSize(),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = "Stats Screen",
|
||||||
|
style = MaterialTheme.typography.headlineMedium
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1115,4 +1115,5 @@
|
|||||||
<string name="message_test_info">This is a generic info message.</string>
|
<string name="message_test_info">This is a generic info message.</string>
|
||||||
<string name="message_test_success">This is a test success message!</string>
|
<string name="message_test_success">This is a test success message!</string>
|
||||||
<string name="message_test_error">Oops, something went wrong :(</string>
|
<string name="message_test_error">Oops, something went wrong :(</string>
|
||||||
|
<string name="label_stats">Stats</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user