Skip to content

Commit

Permalink
Pop back stack when settings back arrow button is pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
temcguir committed Feb 29, 2024
1 parent 4ac20e2 commit 1fb8856
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/google/jetpackcamera/ui/JcaApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private fun JetpackCameraNavHost(
}
composable(SETTINGS_ROUTE) {
SettingsScreen(
onNavigateToPreview = { navController.navigate(PREVIEW_ROUTE) }
onNavigateBack = { navController.popBackStack() }
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ import com.google.jetpackcamera.settings.ui.StabilizationSetting
* Screen used for the Settings feature.
*/
@Composable
fun SettingsScreen(
viewModel: SettingsViewModel = hiltViewModel(),
onNavigateToPreview: () -> Unit
) {
fun SettingsScreen(viewModel: SettingsViewModel = hiltViewModel(), onNavigateBack: () -> Unit) {
val settingsUiState by viewModel.settingsUiState.collectAsState()

Column(
Expand All @@ -49,7 +46,7 @@ fun SettingsScreen(
) {
SettingsPageHeader(
title = stringResource(id = R.string.settings_title),
navBack = onNavigateToPreview
navBack = onNavigateBack
)
SettingsList(uiState = settingsUiState, viewModel = viewModel)
}
Expand Down

0 comments on commit 1fb8856

Please sign in to comment.