mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-11 00:12:24 +01:00
voice and media search are built in now, with a voice intro screen and a new overlay over the car screen
This commit is contained in:
1 parent
30d94bcfb5
commit
b2df84c46b
7 files changed
+205
-112
No files matched your search
@@ -58,9 +58,8 @@ fun CarSettingsScreen() {
|
||||
val theme by CarSettings.appTheme.collectAsState()
|
||||
val uiTheme by CarSettings.uiTheme.collectAsState()
|
||||
val experimentalFeatures by CarSettings.experimentalFeaturesEnabled.collectAsState()
|
||||
val voiceAssistant by CarSettings.voiceAssistantEnabled.collectAsState()
|
||||
val carSensors by CarSettings.carSensorsEnabled.collectAsState()
|
||||
val mediaSearch by CarSettings.mediaSearchEnabled.collectAsState()
|
||||
val systemSpeech by CarSettings.systemSpeech.collectAsState()
|
||||
val display by CarEnvironment.display.collectAsState()
|
||||
val vehicle by CarEnvironment.vehicle.collectAsState()
|
||||
val context = LocalContext.current
|
||||
@@ -138,6 +137,14 @@ fun CarSettingsScreen() {
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
|
||||
ExperimentalFeatureRow(
|
||||
title = "Use the phone's speech recognition",
|
||||
description = "Listens through the phone's own speech service instead of Gearslip's. On " +
|
||||
"most phones that's Google's, which may send your voice to Google. GrapheneOS has " +
|
||||
"none, so Gearslip keeps using its own.",
|
||||
checked = systemSpeech,
|
||||
) { CarSettings.setSystemSpeech(it) }
|
||||
|
||||
WebPageSetting()
|
||||
|
||||
ScreenFit(vehicle)
|
||||
@@ -148,7 +155,7 @@ fun CarSettingsScreen() {
|
||||
experimentalFeatures,
|
||||
) { CarSettings.setExperimentalFeaturesEnabled(it) }
|
||||
if (experimentalFeatures) {
|
||||
ExperimentalFeaturesList(voiceAssistant, carSensors, mediaSearch)
|
||||
ExperimentalFeaturesList(carSensors)
|
||||
}
|
||||
|
||||
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
@@ -205,33 +212,11 @@ private fun <T> ChoiceRow(title: String, options: List<Pair<T, String>>, selecte
|
||||
* so the list reads fine whether there's one entry or several.
|
||||
*/
|
||||
@Composable
|
||||
private fun ExperimentalFeaturesList(voiceAssistant: Boolean, carSensors: Boolean, mediaSearch: Boolean) {
|
||||
private fun ExperimentalFeaturesList(carSensors: Boolean) {
|
||||
Column(
|
||||
Modifier.fillMaxWidth(),
|
||||
verticalArrangement = Arrangement.spacedBy(10.dp),
|
||||
) {
|
||||
ExperimentalFeatureRow(
|
||||
title = "Voice assistant",
|
||||
description = "Push-to-talk and the car's voice button start listening: navigate, " +
|
||||
"play media, call, or open an app by saying so. Can mishear you or act on the " +
|
||||
"wrong command - keep your eyes on the road, and confirm anything it does " +
|
||||
"before you rely on it.",
|
||||
warning = true,
|
||||
checked = voiceAssistant,
|
||||
) { CarSettings.setVoiceAssistantEnabled(it) }
|
||||
|
||||
if (voiceAssistant) {
|
||||
val systemSpeech by CarSettings.systemSpeech.collectAsState()
|
||||
ExperimentalFeatureRow(
|
||||
title = "Use the phone's speech recognition",
|
||||
description = "Understands more words, like place and brand names, but listens " +
|
||||
"through the phone's microphone, not the car's. On most phones this is Google's, " +
|
||||
"which may send your voice to Google. GrapheneOS has none, so it stays with " +
|
||||
"Gearslip's own.",
|
||||
checked = systemSpeech,
|
||||
) { CarSettings.setSystemSpeech(it) }
|
||||
}
|
||||
|
||||
ExperimentalFeatureRow(
|
||||
title = "Vehicle data",
|
||||
description = "Adds a Vehicle data tile: a live, raw dump of the head unit's sensor " +
|
||||
@@ -240,13 +225,6 @@ private fun ExperimentalFeaturesList(voiceAssistant: Boolean, carSensors: Boolea
|
||||
"guess, not a fact, until you've watched one change for yourself.",
|
||||
checked = carSensors,
|
||||
) { CarSettings.setCarSensorsEnabled(it) }
|
||||
|
||||
ExperimentalFeatureRow(
|
||||
title = "Media search",
|
||||
description = "Adds a search button to the media screen. Some apps ignore the search " +
|
||||
"or play something else.",
|
||||
checked = mediaSearch,
|
||||
) { CarSettings.setMediaSearchEnabled(it) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user