Use resources in navbar
This commit is contained in:
		
							parent
							
								
									fcd8b249d4
								
							
						
					
					
						commit
						da3f8d3377
					
				
					 2 changed files with 19 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -13,7 +13,9 @@ import androidx.compose.runtime.Composable
 | 
			
		|||
import androidx.compose.ui.tooling.preview.Preview
 | 
			
		||||
import androidx.compose.ui.unit.dp
 | 
			
		||||
import androidx.hilt.navigation.compose.hiltViewModel
 | 
			
		||||
import be.ugent.sel.studeez.resources
 | 
			
		||||
import be.ugent.sel.studeez.ui.theme.StudeezTheme
 | 
			
		||||
import be.ugent.sel.studeez.R.string as AppText
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Composable
 | 
			
		||||
| 
						 | 
				
			
			@ -28,15 +30,15 @@ fun NavigationBar(
 | 
			
		|||
        elevation = 10.dp
 | 
			
		||||
    ) {
 | 
			
		||||
        BottomNavigationItem(
 | 
			
		||||
            icon = { Icon(imageVector = Icons.Default.List, "Home") },
 | 
			
		||||
            label = { Text(text = "Home") },
 | 
			
		||||
            icon = { Icon(imageVector = Icons.Default.List, resources().getString(AppText.home)) },
 | 
			
		||||
            label = { Text(text = resources().getString(AppText.home)) },
 | 
			
		||||
            selected = false, // TODO
 | 
			
		||||
            onClick = { viewModel.onHomeClick(popUpAndOpen) }
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        BottomNavigationItem(
 | 
			
		||||
            icon = { Icon(imageVector = Icons.Default.Check, "Tasks") },
 | 
			
		||||
            label = { Text(text = "Tasks") },
 | 
			
		||||
            icon = { Icon(imageVector = Icons.Default.Check, resources().getString(AppText.tasks)) },
 | 
			
		||||
            label = { Text(text = resources().getString(AppText.tasks)) },
 | 
			
		||||
            selected = false, // TODO
 | 
			
		||||
            onClick = { viewModel.onTasksClick(popUpAndOpen) }
 | 
			
		||||
        )
 | 
			
		||||
| 
						 | 
				
			
			@ -45,15 +47,15 @@ fun NavigationBar(
 | 
			
		|||
        BottomNavigationItem(icon = {}, onClick = {}, selected = false)
 | 
			
		||||
 | 
			
		||||
        BottomNavigationItem(
 | 
			
		||||
            icon = { Icon(imageVector = Icons.Outlined.DateRange, "Sessions") },
 | 
			
		||||
            label = { Text(text = "Sessions") },
 | 
			
		||||
            icon = { Icon(imageVector = Icons.Outlined.DateRange, resources().getString(AppText.sessions)) },
 | 
			
		||||
            label = { Text(text = resources().getString(AppText.sessions)) },
 | 
			
		||||
            selected = false, // TODO
 | 
			
		||||
            onClick = { viewModel.onSessionsClick(popUpAndOpen) }
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        BottomNavigationItem(
 | 
			
		||||
            icon = { Icon(imageVector = Icons.Default.Person, "Profile") },
 | 
			
		||||
            label = { Text(text = "Profile") },
 | 
			
		||||
            icon = { Icon(imageVector = Icons.Default.Person, resources().getString(AppText.profile)) },
 | 
			
		||||
            label = { Text(text = resources().getString(AppText.profile)) },
 | 
			
		||||
            selected = false, // TODO
 | 
			
		||||
            onClick = { viewModel.onProfileClick(popUpAndOpen) }
 | 
			
		||||
        )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue