From 8593e59b309de0787bb0beb4e9cc05c634dbeb53 Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Sun, 29 Nov 2026 20:47:53 -0800 Subject: [PATCH] The car's Settings keeps what you'd change in the car; speech, the browser's start page and experimental features are set on the phone --- .../gearslip/car/CarSettingsScreen.kt | 86 +------------------ 1 file changed, 2 insertions(+), 84 deletions(-) diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/car/CarSettingsScreen.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/car/CarSettingsScreen.kt index 3a6c3e2..9fed8ea 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/car/CarSettingsScreen.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/car/CarSettingsScreen.kt @@ -74,11 +74,7 @@ fun CarSettingsScreen() { val theme by CarSettings.appTheme.collectAsState() val uiTheme by CarSettings.uiTheme.collectAsState() val darkStyle by CarSettings.darkStyle.collectAsState() - val experimentalFeatures by CarSettings.experimentalFeaturesEnabled.collectAsState() - val carSensors by CarSettings.carSensorsEnabled.collectAsState() - val adaptiveVideo by CarSettings.adaptiveVideoEnabled.collectAsState() val clusterVideo by CarSettings.clusterVideoEnabled.collectAsState() - val systemSpeech by CarSettings.systemSpeech.collectAsState() val display by CarEnvironment.display.collectAsState() val vehicle by CarEnvironment.vehicle.collectAsState() val context = LocalContext.current @@ -230,9 +226,6 @@ fun CarSettingsScreen() { if (speakDirections) item { SwitchRow(stringResource(R.string.car_directions_over_music), stringResource(R.string.car_directions_over_music_note), directionsOverMusic) { CarSettings.setDirectionsOverMusic(it) } } - item { - SwitchRow(stringResource(R.string.car_phone_speech), stringResource(R.string.carset_phone_speech_note), systemSpeech) { CarSettings.setSystemSpeech(it) } - } } 3 -> { item { Group(stringResource(R.string.car_group_warnings)) } @@ -244,20 +237,12 @@ fun CarSettingsScreen() { } } else -> { + // Set-up settings (speech, the browser's start page, experimental features) + // stay on the phone: they're set once, parked, not glanced at while driving. item { Group(stringResource(R.string.car_group_more)) } - item { WebPageSetting() } item { SwitchRow(stringResource(R.string.car_cluster_video), stringResource(R.string.car_cluster_video_note), clusterVideo) { CarSettings.setClusterVideoEnabled(it) } } - item { - SwitchRow(stringResource(R.string.car_experimental), stringResource(R.string.car_experimental_note), experimentalFeatures) { CarSettings.setExperimentalFeaturesEnabled(it) } - } - if (experimentalFeatures) item { - Column(verticalArrangement = Arrangement.spacedBy(10.dp)) { - SubGroup(stringResource(R.string.carset_experimental_heading)) - ExperimentalFeaturesList(carSensors, adaptiveVideo) - } - } item { Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { SwitchRow( @@ -412,30 +397,6 @@ private fun ChoiceButtons(options: List>, selected: T, onSel } } -/** - * Individually-switched experimental features, shown once the driver has opted into - * experimental features as a whole. Each is its own row - a title, what it does, and a switch - - * so the list reads fine whether there's one entry or several. - */ -@Composable -private fun ExperimentalFeaturesList(carSensors: Boolean, adaptiveVideo: Boolean) { - Column( - Modifier.fillMaxWidth(), - verticalArrangement = Arrangement.spacedBy(10.dp), - ) { - SwitchRow( - title = stringResource(R.string.car_vehicle_data), - description = stringResource(R.string.carset_vehicle_data_note), - checked = carSensors, - ) { CarSettings.setCarSensorsEnabled(it) } - SwitchRow( - title = stringResource(R.string.car_adaptive_video), - description = stringResource(R.string.carset_adaptive_note), - checked = adaptiveVideo, - ) { CarSettings.setAdaptiveVideoEnabled(it) } - } -} - @Composable private fun SwitchRow( title: String, @@ -470,49 +431,6 @@ private fun SwitchRow( } } -/** The URL (or raw HTML) the Browser app shows. Edited with [CarKeyboard] - no phone in hand needed. */ -@Composable -private fun WebPageSetting() { - val context = LocalContext.current - var editing by remember { mutableStateOf(false) } - var url by remember { mutableStateOf(AppSettings.startupUrl(context)) } - - Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { - Text(stringResource(R.string.web_page), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.primary) - Surface( - onClick = { editing = !editing }, - shape = MaterialTheme.shapes.large, - color = MaterialTheme.colorScheme.surfaceContainerHigh, - modifier = Modifier.fillMaxWidth(), - ) { - Text( - url.ifEmpty { stringResource(R.string.carset_web_default) }, - style = MaterialTheme.typography.bodyLarge, - color = if (url.isEmpty()) MaterialTheme.colorScheme.onSurfaceVariant else MaterialTheme.colorScheme.onSurface, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - modifier = Modifier.padding(horizontal = 16.dp, vertical = 14.dp), - ) - } - Text( - stringResource(R.string.carset_web_note), - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - ) - if (editing) { - CarKeyboard( - url, - onTextChange = { - url = it - AppSettings.setStartupUrl(context, it) - }, - onSubmit = { editing = false }, - onDismiss = { editing = false }, - ) - } - } -} - @Composable private fun Info(label: String, value: String) { Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {