Add dummy stats screen to bottom navigation

This commit is contained in:
jonasgaudian
2026-02-16 13:20:06 +01:00
parent d2d2f53b59
commit ef90df2150
4 changed files with 35 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ import eu.gaudian.translator.view.settings.DictionaryOptionsScreen
import eu.gaudian.translator.view.settings.SettingsRoutes
import eu.gaudian.translator.view.settings.TranslationSettingsScreen
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.vocabulary.CategoryDetailScreen
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)
val mainTabRoutes = setOf(
Screen.Home.route,
Screen.Stats.route,
Screen.Translation.route,
Screen.Vocabulary.route,
Screen.Dictionary.route,
@@ -125,6 +127,10 @@ fun AppNavHost(
HomeScreen(navController = navController)
}
composable(Screen.Stats.route) {
StatsScreen(navController = navController)
}
// Define all other navigation graphs at the same top level.
homeGraph(navController)
translationGraph(navController)

View File

@@ -63,6 +63,7 @@ sealed class Screen(
val unselectedIcon: ImageVector
) {
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 Vocabulary : Screen("vocabulary", R.string.label_vocabulary, AppIcons.VocabularyFilled, AppIcons.VocabularyOutlined)
object Settings : Screen("settings", R.string.title_settings, AppIcons.SettingsFilled, AppIcons.SettingsOutlined)
@@ -72,7 +73,7 @@ sealed class Screen(
companion object {
fun getAllScreens(showExperimental: Boolean = false): List<Screen> {
return listOf(Home, Vocabulary)
return listOf(Home, Vocabulary, Stats)
}
fun getMoreMenuItems(showExperimental: Boolean = false): List<Screen> {

View File

@@ -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
)
}
}

View File

@@ -1115,4 +1115,5 @@
<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_error">Oops, something went wrong :(</string>
<string name="label_stats">Stats</string>
</resources>