Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds label to the bottomNav items #269

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Text
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationBar
Expand Down Expand Up @@ -133,6 +134,7 @@ private fun FantasyPremierLeagueBottomNavigation(navController: NavHostControlle
)
},
selected = currentRoute == bottomNavigationItem.route,
label = { Text(text = bottomNavigationItem.label)},
onClick = {
navController.navigate(bottomNavigationItem.route) {
popUpTo(navController.graph.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,27 @@ sealed class Screen(val title: String) {
data class BottomNavigationitem(
val route: String,
val icon: ImageVector,
val iconContentDescription: String
val iconContentDescription: String,
val label: String
)

val bottomNavigationItems = listOf(
BottomNavigationitem(
Screen.PlayerListScreen.title,
Icons.Default.Person,
"Player"
iconContentDescription = "Player",
label = "Players"
),
BottomNavigationitem(
Screen.FixtureListScreen.title,
Icons.Filled.DateRange,
"Fixtures"
iconContentDescription = "Fixtures",
label = "Fixtures"
),
BottomNavigationitem(
Screen.LeagueStandingsListScreen.title,
Icons.Filled.List,
"League"
iconContentDescription = "League",
label = "League"
)
)