Skip to content

Commit 57ad918

Browse files
committed
Cloud: drop motor-sound safety prompt, sweep 28 unused strings, polish named-backup UX
Motor sound: removed the one-time safety dialog (engine_safety_title / message / ok) and the engineSafetyShown gate. Toggling Engine sound is now a single click; the surrounding hint plus the lower engineHeadphonesOnly toggle already cover the safety guidance. Unused-string sweep across all 15 locale files: 25 keys with zero references (accent_blue..accent_teal, about_crash_logs_hint, alarm_name, alarm_section_condition, cloud_no_folder, cloud_upload_failed, engine_preview, engine_preview_parked_only, engine_volume_auto_hint, engine_volume_auto_label, external_gps_live_speed/no_results/scanning, flic_no_buttons, flic_status_found_paired, flic_status_scanning, section_watch_buttons, sources_apply_calibration_clamped_fmt, watch_button_1, watch_button_2) plus the 3 engine_safety_* keys above. engine_preset_* stays because EngineTypePicker resolves them dynamically via getIdentifier. Long-press backup polish: - Backup name field auto-focuses 60 ms after the dialog mounts so the rider can start typing immediately. - Successful named backup toasts "Backed up as <name>" (new cloud_backup_named_success string, localised across 14 locales); the default backup still toasts the generic success message. Phone code 77 -> 78, wear 100078 -> 100079; versionName stays at 0.7.0.
1 parent 5325c2b commit 57ad918

21 files changed

Lines changed: 32 additions & 410 deletions

File tree

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ android {
2727
applicationId = "com.eried.eucplanet"
2828
minSdk = 29
2929
targetSdk = 35
30-
versionCode = 77
30+
versionCode = 78
3131
versionName = "0.7.0"
3232

3333
val buildStamp = SimpleDateFormat("yyMMdd.HHmm")

app/src/main/java/com/eried/eucplanet/data/model/AppSettings.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,7 @@ data class AppSettings(
305305
/** When a voice announce plays: "DUCK" (-12 dB), "PAUSE" (engine silent during speech), "MIX" (no ducking). */
306306
val engineDuckOnVoice: String = "DUCK",
307307
/** If true, engine only plays when wired/BT audio is routed to headphones (safety). */
308-
val engineHeadphonesOnly: Boolean = false,
309-
/** True once the one-time safety disclosure has been acknowledged. */
310-
val engineSafetyShown: Boolean = false
308+
val engineHeadphonesOnly: Boolean = false
311309
)
312310

313311
enum class FlicAction(val labelRes: Int) {

app/src/main/java/com/eried/eucplanet/data/store/SettingsJson.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ object SettingsJson {
161161
put("engineBrake", s.engineBrake)
162162
put("engineDuckOnVoice", s.engineDuckOnVoice)
163163
put("engineHeadphonesOnly", s.engineHeadphonesOnly)
164-
put("engineSafetyShown", s.engineSafetyShown)
165164
put("raceboxMapX", s.raceboxMapX)
166165
put("raceboxMapY", s.raceboxMapY)
167166
put("raceboxMapZ", s.raceboxMapZ)
@@ -296,7 +295,6 @@ object SettingsJson {
296295
engineBrake = j.optString("engineBrake", base.engineBrake),
297296
engineDuckOnVoice = j.optString("engineDuckOnVoice", base.engineDuckOnVoice),
298297
engineHeadphonesOnly = j.optBoolean("engineHeadphonesOnly", base.engineHeadphonesOnly),
299-
engineSafetyShown = j.optBoolean("engineSafetyShown", base.engineSafetyShown),
300298
raceboxMapX = j.optString("raceboxMapX", base.raceboxMapX),
301299
raceboxMapY = j.optString("raceboxMapY", base.raceboxMapY),
302300
raceboxMapZ = j.optString("raceboxMapZ", base.raceboxMapZ),

app/src/main/java/com/eried/eucplanet/ui/settings/SettingsScreen.kt

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.foundation.clickable
1111
import androidx.compose.foundation.combinedClickable
1212
import androidx.compose.foundation.relocation.BringIntoViewRequester
1313
import androidx.compose.foundation.relocation.bringIntoViewRequester
14+
import androidx.compose.ui.focus.focusRequester
1415
import androidx.compose.foundation.horizontalScroll
1516
import androidx.compose.foundation.layout.Box
1617
import androidx.compose.foundation.layout.Arrangement
@@ -1520,6 +1521,7 @@ private fun CloudTab(
15201521
CloudEvent.FolderSet -> null
15211522
CloudEvent.FolderFailed -> sFolderFailed
15221523
CloudEvent.BackupSuccess -> sBackupOk
1524+
is CloudEvent.BackupNamedSuccess -> context.getString(R.string.cloud_backup_named_success, event.name)
15231525
CloudEvent.BackupFailed -> sBackupFail
15241526
is CloudEvent.BackupExists -> {
15251527
overwritePrompt = event.name
@@ -2249,16 +2251,11 @@ private fun EngineSoundSection(
22492251
viewModel: SettingsViewModel,
22502252
parked: Boolean
22512253
) {
2252-
var showSafety by remember { mutableStateOf(false) }
2253-
22542254
Column(verticalArrangement = Arrangement.spacedBy(16.dp)) {
22552255
SwitchSetting(
22562256
label = stringResource(R.string.engine_sound_enabled),
22572257
checked = settings.engineSoundEnabled
22582258
) { enabled ->
2259-
if (enabled && !settings.engineSafetyShown) {
2260-
showSafety = true
2261-
}
22622259
viewModel.updateEngineSoundEnabled(enabled)
22632260
}
22642261
Text(
@@ -2395,23 +2392,6 @@ private fun EngineSoundSection(
23952392
)
23962393
}
23972394
}
2398-
2399-
if (showSafety) {
2400-
AlertDialog(
2401-
onDismissRequest = {
2402-
showSafety = false
2403-
viewModel.markEngineSafetyShown()
2404-
},
2405-
title = { Text(stringResource(R.string.engine_safety_title)) },
2406-
text = { Text(stringResource(R.string.engine_safety_message)) },
2407-
confirmButton = {
2408-
TextButton(onClick = {
2409-
showSafety = false
2410-
viewModel.markEngineSafetyShown()
2411-
}) { Text(stringResource(R.string.engine_safety_ok)) }
2412-
}
2413-
)
2414-
}
24152395
}
24162396

24172397
@OptIn(ExperimentalMaterial3Api::class)
@@ -2956,6 +2936,13 @@ private fun NamedBackupDialog(
29562936
val preview = sanitized?.let {
29572937
stringResource(R.string.cloud_backup_name_preview, "eucplanet_settings-$it.json")
29582938
}
2939+
val focusRequester = remember { androidx.compose.ui.focus.FocusRequester() }
2940+
LaunchedEffect(Unit) {
2941+
// Tiny delay lets the dialog finish its mount animation; without it
2942+
// the request can land before the field is attached and silently no-op.
2943+
kotlinx.coroutines.delay(60)
2944+
runCatching { focusRequester.requestFocus() }
2945+
}
29592946
AlertDialog(
29602947
onDismissRequest = onDismiss,
29612948
text = {
@@ -2965,7 +2952,9 @@ private fun NamedBackupDialog(
29652952
onValueChange = { raw = it },
29662953
label = { Text(stringResource(R.string.cloud_backup_name_label)) },
29672954
singleLine = true,
2968-
modifier = Modifier.fillMaxWidth()
2955+
modifier = Modifier
2956+
.fillMaxWidth()
2957+
.focusRequester(focusRequester)
29692958
)
29702959
if (preview != null) {
29712960
Text(

app/src/main/java/com/eried/eucplanet/ui/settings/SettingsViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ class SettingsViewModel @Inject constructor(
145145
fun updateEngineBrake(v: String) = update { copy(engineBrake = v) }
146146
fun updateEngineDuckOnVoice(v: String) = update { copy(engineDuckOnVoice = v) }
147147
fun updateEngineHeadphonesOnly(v: Boolean) = update { copy(engineHeadphonesOnly = v) }
148-
fun markEngineSafetyShown() = update { copy(engineSafetyShown = true) }
149148

150149
fun previewEngine(key: String) {
151150
viewModelScope.launch {
@@ -371,7 +370,7 @@ class SettingsViewModel @Inject constructor(
371370
fun backupSettingsNamed(name: String, overwrite: Boolean) {
372371
viewModelScope.launch {
373372
_cloudEvent.value = when (syncManager.backupSettingsAs(name, overwrite)) {
374-
BackupOutcome.Saved -> CloudEvent.BackupSuccess
373+
BackupOutcome.Saved -> CloudEvent.BackupNamedSuccess(name)
375374
BackupOutcome.AlreadyExists -> CloudEvent.BackupExists(name)
376375
BackupOutcome.Failed -> CloudEvent.BackupFailed
377376
}
@@ -451,6 +450,7 @@ sealed interface CloudEvent {
451450
data object FolderSet : CloudEvent
452451
data object FolderFailed : CloudEvent
453452
data object BackupSuccess : CloudEvent
453+
data class BackupNamedSuccess(val name: String) : CloudEvent
454454
data object BackupFailed : CloudEvent
455455
data class BackupExists(val name: String) : CloudEvent
456456
data object RestoreSuccess : CloudEvent

app/src/main/res/values-b+es+419/strings.xml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@
121121
<string name="watch_dial_rotation_value">%1$d°</string>
122122

123123
<!-- Watch hardware buttons -->
124-
<string name="section_watch_buttons">Botones físicos</string>
125-
<string name="watch_button_1">Botón 1</string>
126-
<string name="watch_button_2">Botón 2</string>
127124
<string name="watch_button_click_label">Clic</string>
128125
<string name="watch_button_hold_label">Presión larga</string>
129126

@@ -135,14 +132,14 @@
135132
<string name="cloud_choose_folder">Elegir carpeta</string>
136133
<string name="cloud_change_folder">Cambiar carpeta</string>
137134
<string name="cloud_remove_folder">Desvincular</string>
138-
<string name="cloud_no_folder">Ninguna carpeta seleccionada</string>
139135
<string name="cloud_folder_label">Carpeta: %1$s</string>
140136
<string name="section_cloud_settings">Respaldo de configuración</string>
141137
<string name="cloud_backup_now">Respaldar</string>
142138
<string name="cloud_restore">Restaurar</string>
143139
<string name="cloud_last_backup">Último respaldo: %1$s</string>
144140
<string name="cloud_last_backup_never">Sin respaldo aún</string>
145141
<string name="cloud_backup_success">Configuración respaldada</string>
142+
<string name="cloud_backup_named_success">Respaldado como %1$s</string>
146143
<string name="cloud_backup_failed">Falló el respaldo. Revisa el acceso a la carpeta.</string>
147144
<string name="cloud_restore_success">Configuración restaurada</string>
148145
<string name="cloud_restore_failed">No se encontró respaldo en la carpeta</string>
@@ -160,7 +157,6 @@
160157
<string name="sync_conflict_ignore">Omitir todos los conflictos</string>
161158
<string name="cloud_uploaded_on">Respaldado el %1$s</string>
162159
<string name="cloud_not_uploaded">Sin respaldar todavía</string>
163-
<string name="cloud_upload_failed">Falló la última subida</string>
164160
<string name="cloud_restore_confirm_title">Restaurar configuración</string>
165161
<string name="cloud_restore_confirm_body_p1">Tu configuración actual será reemplazada por la del respaldo.</string>
166162
<string name="cloud_restore_confirm_body_p2">Los gestos de Flic se restauran, pero los botones y la rueda deben emparejarse de nuevo en este celular. Sus enlaces Bluetooth viven en Android, no en la app.</string>
@@ -202,12 +198,6 @@
202198
<string name="theme_light">Claro</string>
203199
<string name="theme_system">Seguir sistema</string>
204200
<string name="accent_color">Color de acento</string>
205-
<string name="accent_blue">Azul</string>
206-
<string name="accent_green">Verde</string>
207-
<string name="accent_orange">Naranja</string>
208-
<string name="accent_purple">Morado</string>
209-
<string name="accent_teal">Verde azulado</string>
210-
<string name="accent_pink">Rosa</string>
211201
<string name="tts_switch_title">¿Cambiar voz a %1$s?</string>
212202
<string name="tts_switch_body">La voz de síntesis actual no coincide con el idioma seleccionado. ¿Cambiar a una voz en %1$s para los anuncios?</string>
213203
<string name="tts_switch_yes">Cambiar voz</string>
@@ -268,7 +258,6 @@
268258
<string name="external_gps_pair_button">Iniciar búsqueda</string>
269259
<string name="external_gps_pair_action">Vincular</string>
270260
<string name="external_gps_stop_scan">Detener búsqueda</string>
271-
<string name="flic_no_buttons">No hay botones Flic emparejados</string>
272261
<string name="flic_forget">Olvidar</string>
273262
<string name="flic_forget_title">¿Olvidar este botón?</string>
274263
<string name="flic_forget_body">%1$s se desemparejará y sus acciones se borrarán. Puedes volver a emparejarlo cuando quieras.</string>
@@ -368,8 +357,6 @@
368357
<string name="alarm_test_default">Prueba de alarma</string>
369358

370359
<!-- Flic scan status -->
371-
<string name="flic_status_scanning">Buscando…</string>
372-
<string name="flic_status_found_paired">Botón emparejado encontrado</string>
373360
<string name="flic_status_found_connecting">Botón encontrado, conectando…</string>
374361
<string name="flic_status_connected_pairing">Conectado, emparejando…</string>
375362
<string name="flic_status_accept_pairing">Acepta el emparejamiento en el celular…</string>
@@ -462,8 +449,6 @@
462449
<string name="alarm_edit">Editar alarma</string>
463450
<string name="alarm_delete_title">¿Eliminar esta alarma?</string>
464451
<string name="alarm_delete_body">%1$s será eliminada. Esto no se puede deshacer.</string>
465-
<string name="alarm_name">Nombre (opcional)</string>
466-
<string name="alarm_section_condition">Condición</string>
467452
<string name="alarm_metric_label">Métrica</string>
468453
<string name="alarm_comparator_label">Condición</string>
469454
<string name="alarm_threshold_fmt">Umbral: %1$s %2$s</string>
@@ -496,7 +481,6 @@
496481
<string name="sources_apply_calibration">Calibrar rueda</string>
497482
<string name="sources_apply_calibration_title">Aplicar calibración de velocidad</string>
498483
<string name="sources_apply_calibration_body_fmt">¿Establecer la calibración de velocidad de la rueda en %1$+.1f %%?\n\nPodés cambiarla después en Parámetros de la rueda.</string>
499-
<string name="sources_apply_calibration_clamped_fmt">El valor calculado se limitó al rango de ±15 %% admitido por Parámetros de la rueda. Nuevo valor: %1$+.1f %%.</string>
500484
<string name="sources_apply">Aplicar</string>
501485
<string name="sources_cancel">Cancelar</string>
502486

@@ -526,7 +510,6 @@
526510

527511
<!-- About / crash logs -->
528512
<string name="about_crash_logs">Registros de fallos</string>
529-
<string name="about_crash_logs_hint">Toca un archivo para compartirlo con el desarrollador.</string>
530513
<string name="about_crash_logs_empty">Sin fallos registrados</string>
531514
<string name="about_share_crash">Compartir registro de fallo</string>
532515
<string name="about_thanks">Créditos</string>
@@ -544,16 +527,10 @@
544527
<string name="section_engine_sound">Sonido de motor</string>
545528
<string name="engine_sound_enabled">Generar sonido de motor</string>
546529
<string name="engine_sound_enabled_hint">Las RPM del motor siguen en tiempo real la velocidad y la carga de tu rueda.</string>
547-
<string name="engine_safety_title">Atención</string>
548-
<string name="engine_safety_message">El sonido del motor puede tapar el ruido del tráfico. Usa volúmenes bajos en la ciudad y considera un auricular en un solo oído para mantenerte atento al entorno.</string>
549-
<string name="engine_safety_ok">Entendido</string>
550530
<string name="engine_type_label">Motor</string>
551-
<string name="engine_preview">Vista previa</string>
552531
<string name="engine_source_sampled">Sampleado</string>
553532
<string name="engine_source_synth">Sintético</string>
554533
<string name="engine_volume">Volumen</string>
555-
<string name="engine_volume_auto_label">Ajustar por velocidad</string>
556-
<string name="engine_volume_auto_hint">Más fuerte a baja velocidad y más bajo al acelerar para que los peatones te escuchen cerca de 0 km/h.</string>
557534
<string name="engine_muffler_label">Escape</string>
558535
<string name="engine_muffler_open">Abierto</string>
559536
<string name="engine_muffler_half">Medio</string>
@@ -582,7 +559,6 @@
582559
<string name="engine_headphones_only_hint">Omite el altavoz del teléfono. El motor suena solo cuando hay audio por cable o Bluetooth.</string>
583560

584561
<!-- Motor sound: generic preset names + parked hint -->
585-
<string name="engine_preview_parked_only">Vista previa desactivada mientras te mueves, detente para probar los sonidos.</string>
586562
<string name="engine_preset_two_stroke">2 tiempos</string>
587563
<string name="engine_preset_four_stroke_single">4 tiempos monocilíndrico</string>
588564
<string name="engine_preset_quad_bike">Cuatrimoto</string>

0 commit comments

Comments
 (0)