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.tooling.preview.Preview | ||||||
| import androidx.compose.ui.unit.dp | import androidx.compose.ui.unit.dp | ||||||
| import androidx.hilt.navigation.compose.hiltViewModel | 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.ui.theme.StudeezTheme | ||||||
|  | import be.ugent.sel.studeez.R.string as AppText | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @Composable | @Composable | ||||||
|  | @ -28,15 +30,15 @@ fun NavigationBar( | ||||||
|         elevation = 10.dp |         elevation = 10.dp | ||||||
|     ) { |     ) { | ||||||
|         BottomNavigationItem( |         BottomNavigationItem( | ||||||
|             icon = { Icon(imageVector = Icons.Default.List, "Home") }, |             icon = { Icon(imageVector = Icons.Default.List, resources().getString(AppText.home)) }, | ||||||
|             label = { Text(text = "Home") }, |             label = { Text(text = resources().getString(AppText.home)) }, | ||||||
|             selected = false, // TODO |             selected = false, // TODO | ||||||
|             onClick = { viewModel.onHomeClick(popUpAndOpen) } |             onClick = { viewModel.onHomeClick(popUpAndOpen) } | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|         BottomNavigationItem( |         BottomNavigationItem( | ||||||
|             icon = { Icon(imageVector = Icons.Default.Check, "Tasks") }, |             icon = { Icon(imageVector = Icons.Default.Check, resources().getString(AppText.tasks)) }, | ||||||
|             label = { Text(text = "Tasks") }, |             label = { Text(text = resources().getString(AppText.tasks)) }, | ||||||
|             selected = false, // TODO |             selected = false, // TODO | ||||||
|             onClick = { viewModel.onTasksClick(popUpAndOpen) } |             onClick = { viewModel.onTasksClick(popUpAndOpen) } | ||||||
|         ) |         ) | ||||||
|  | @ -45,15 +47,15 @@ fun NavigationBar( | ||||||
|         BottomNavigationItem(icon = {}, onClick = {}, selected = false) |         BottomNavigationItem(icon = {}, onClick = {}, selected = false) | ||||||
| 
 | 
 | ||||||
|         BottomNavigationItem( |         BottomNavigationItem( | ||||||
|             icon = { Icon(imageVector = Icons.Outlined.DateRange, "Sessions") }, |             icon = { Icon(imageVector = Icons.Outlined.DateRange, resources().getString(AppText.sessions)) }, | ||||||
|             label = { Text(text = "Sessions") }, |             label = { Text(text = resources().getString(AppText.sessions)) }, | ||||||
|             selected = false, // TODO |             selected = false, // TODO | ||||||
|             onClick = { viewModel.onSessionsClick(popUpAndOpen) } |             onClick = { viewModel.onSessionsClick(popUpAndOpen) } | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|         BottomNavigationItem( |         BottomNavigationItem( | ||||||
|             icon = { Icon(imageVector = Icons.Default.Person, "Profile") }, |             icon = { Icon(imageVector = Icons.Default.Person, resources().getString(AppText.profile)) }, | ||||||
|             label = { Text(text = "Profile") }, |             label = { Text(text = resources().getString(AppText.profile)) }, | ||||||
|             selected = false, // TODO |             selected = false, // TODO | ||||||
|             onClick = { viewModel.onProfileClick(popUpAndOpen) } |             onClick = { viewModel.onProfileClick(popUpAndOpen) } | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
|  | @ -18,7 +18,6 @@ | ||||||
|     <string name="password_match_error">Passwords do not match.</string> |     <string name="password_match_error">Passwords do not match.</string> | ||||||
|     <string name="already_user">Already have an account? Log in.</string> |     <string name="already_user">Already have an account? Log in.</string> | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     <!-- LoginScreen --> |     <!-- LoginScreen --> | ||||||
|     <string name="not_already_user">Don\'t have an account yet? Sign up.</string> |     <string name="not_already_user">Don\'t have an account yet? Sign up.</string> | ||||||
|     <string name="sign_in">Sign in</string> |     <string name="sign_in">Sign in</string> | ||||||
|  | @ -31,6 +30,15 @@ | ||||||
|     <string name="home">Home</string> |     <string name="home">Home</string> | ||||||
|     <string name="start_session">Start session</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 --> |     <!-- Drawer / SideMenu --> | ||||||
|     <string name="log_out">Log out</string> |     <string name="log_out">Log out</string> | ||||||
|     <string name="profile_picture_description">Profile Picture</string> |     <string name="profile_picture_description">Profile Picture</string> | ||||||
|  |  | ||||||
		Reference in a new issue