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) } | ||||
|         ) | ||||
|  |  | |||
|  | @ -18,7 +18,6 @@ | |||
|     <string name="password_match_error">Passwords do not match.</string> | ||||
|     <string name="already_user">Already have an account? Log in.</string> | ||||
| 
 | ||||
| 
 | ||||
|     <!-- LoginScreen --> | ||||
|     <string name="not_already_user">Don\'t have an account yet? Sign up.</string> | ||||
|     <string name="sign_in">Sign in</string> | ||||
|  | @ -31,6 +30,15 @@ | |||
|     <string name="home">Home</string> | ||||
|     <string name="start_session">Start session</string> | ||||
| 
 | ||||
|     <!-- Tasks --> | ||||
|     <string name="tasks">Tasks</string> | ||||
| 
 | ||||
|     <!-- Sessions --> | ||||
|     <string name="sessions">Sessions</string> | ||||
| 
 | ||||
|     <!-- Profile --> | ||||
|     <string name="profile">Profile</string> | ||||
| 
 | ||||
|     <!-- Drawer / SideMenu --> | ||||
|     <string name="log_out">Log out</string> | ||||
|     <string name="profile_picture_description">Profile Picture</string> | ||||
|  |  | |||
		Reference in a new issue