diff --git a/app/src/main/java/com/google/jetpackcamera/ui/JcaApp.kt b/app/src/main/java/com/google/jetpackcamera/ui/JcaApp.kt index aed74333c..ea6795e72 100644 --- a/app/src/main/java/com/google/jetpackcamera/ui/JcaApp.kt +++ b/app/src/main/java/com/google/jetpackcamera/ui/JcaApp.kt @@ -72,7 +72,7 @@ private fun JetpackCameraNavHost( } composable(SETTINGS_ROUTE) { SettingsScreen( - onNavigateToPreview = { navController.navigate(PREVIEW_ROUTE) } + onNavigateBack = { navController.popBackStack() } ) } } diff --git a/feature/settings/src/main/java/com/google/jetpackcamera/settings/SettingsScreen.kt b/feature/settings/src/main/java/com/google/jetpackcamera/settings/SettingsScreen.kt index fd8b32c27..b21d8e624 100644 --- a/feature/settings/src/main/java/com/google/jetpackcamera/settings/SettingsScreen.kt +++ b/feature/settings/src/main/java/com/google/jetpackcamera/settings/SettingsScreen.kt @@ -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( @@ -49,7 +46,7 @@ fun SettingsScreen( ) { SettingsPageHeader( title = stringResource(id = R.string.settings_title), - navBack = onNavigateToPreview + navBack = onNavigateBack ) SettingsList(uiState = settingsUiState, viewModel = viewModel) }