fix(auto): remove the preset-cycling custom action, superseded by folder

The equalizer's preset-cycling custom action (eq_preset_siguiente) and
its ic_auto_eq_preset drawable are no longer needed now that the
"Ecualizador" folder lists all six presets directly: the folder replaces
what the cycle action did, and this frees a scarce Android Auto custom
action slot.

The on/off toggle is now the equalizer's only custom action.
This commit is contained in:
2026-07-31 19:15:31 +02:00
parent 8423ccdd0c
commit f19666508d
3 changed files with 109 additions and 173 deletions
+28 -33
View File
@@ -111,7 +111,6 @@ Emisora emisoraDesdeMediaItem(MediaItem mediaItem) {
/// `MediaControl`/`customAction` namespace, never compared against a
/// media id).
const accionEqToggle = 'eq_toggle';
const accionEqPresetSiguiente = 'eq_preset_siguiente';
/// Advances to the NEXT factory preset after [actual] in [presets] order
/// (Design "EQ custom actions — cycling presets", item 4): wraps around
@@ -154,30 +153,33 @@ String nombrePresetVisible(AppLocalizations l10n, String nombre) {
}
/// Builds the equalizer's custom-action `MediaControl`s for the now-playing
/// screen (Design "EQ custom actions", item 4) — deliberately just 2: an
/// on/off toggle plus a cycling-preset action, NOT one action per preset,
/// since Android Auto only surfaces a limited number of custom actions.
/// Folding "off" into the preset cycle (one button walking
/// off → preset 1 → preset 2 → ... → preset 6 → off) was considered and
/// REJECTED: with 6 presets that can take up to 6 taps to switch the EQ
/// off while driving, which is worse for a driver than a dedicated one-tap
/// toggle. Do not "simplify" this back down to a single action.
/// screen (decision `auto/ecualizador-diseno`) — exactly 1: an on/off
/// toggle. The previous design paired this with a SECOND action that cycled
/// through the six factory presets; that action is REMOVED. On-device
/// feedback: many head units render custom actions icon-first, so two
/// static, non-parametrized glyphs sitting side by side looked identical/
/// dead even though the toggle's own icon DID change and the cycle action
/// DID work — a monochrome icon simply cannot legibly encode "which of six
/// presets" the way a browsable list's text rows can. Preset selection now
/// lives in the "Ecualizador" browsable folder instead (see
/// [itemsEcualizadorAuto]), which also frees this scarce custom-action
/// slot. Do NOT re-add a preset-cycling custom action; extend the folder
/// instead.
/// Empty when [disponible] is false (gate on EQ availability, mirrors the
/// existing `debeReaplicarEcualizador`/`_eqDisponible` gate) — a device
/// without the native Equalizer effect gets no EQ actions at all, not
/// broken ones.
///
/// On-device feedback follow-up: both actions used to reuse the SAME
/// `ic_stat_pluriwave` drawable and were visually indistinguishable on a
/// car head unit, which foregrounds the icon over the label. Each action
/// now gets its own dedicated drawable (`ic_auto_eq_on`/`ic_auto_eq_off`/
/// `ic_auto_eq_preset`), and the toggle's icon itself reflects [activo]
/// (not just its label) so on/off is legible at a glance. Pure, no
/// On-device feedback follow-up: this action used to reuse the SAME
/// `ic_stat_pluriwave` drawable as everything else and was visually
/// indistinguishable on a car head unit, which foregrounds the icon over
/// the label. It now gets its own dedicated drawables
/// (`ic_auto_eq_on`/`ic_auto_eq_off`), and the icon itself reflects
/// [activo] (not just its label) so on/off is legible at a glance. Pure, no
/// handler dependency.
List<MediaControl> controlesEcualizadorPersonalizados({
required bool disponible,
required bool activo,
required PresetEcualizador presetActual,
required AppLocalizations l10n,
}) {
if (!disponible) return const [];
@@ -191,13 +193,6 @@ List<MediaControl> controlesEcualizadorPersonalizados({
: l10n.eqCustomActionEnableLabel,
name: accionEqToggle,
),
MediaControl.custom(
androidIcon: 'drawable/ic_auto_eq_preset',
label: l10n.eqCustomActionPresetLabel(
nombrePresetVisible(l10n, presetActual.nombre),
),
name: accionEqPresetSiguiente,
),
];
}
@@ -568,7 +563,6 @@ class PluriWaveAudioHandler extends BaseAudioHandler
controlesEcualizadorPersonalizados(
disponible: _eqDisponible,
activo: _ecualizadorActivo,
presetActual: _presetActual,
l10n: _textos,
);
@@ -1176,14 +1170,17 @@ class PluriWaveAudioHandler extends BaseAudioHandler
await _reproducirEntradaCola(anterior.actual);
}
/// Dispatches the equalizer's 2 custom actions (item 4, Design "EQ custom
/// actions"): `accionEqToggle` flips on/off, `accionEqPresetSiguiente`
/// cycles to the next factory preset. Both delegate to the existing
/// [setEcualizadorActivo]/[aplicarPreset] — the SAME entry points the
/// Dispatches the equalizer's only custom action (decision
/// `auto/ecualizador-diseno`): `accionEqToggle` flips on/off, delegating
/// to the existing [setEcualizadorActivo] — the SAME entry point the
/// phone settings screen uses via `EstadoEcualizador` — so a car tap and a
/// phone tap have identical effects and both refresh the custom action's
/// label via `_actualizarControlesEq()` (already wired into those two
/// methods). Any other [name] is a no-op — never throws.
/// phone tap have identical effects and both refresh the action's label
/// via `_actualizarControlesEq()` (already wired into that method). The
/// preset-cycling action that used to live here is REMOVED — preset
/// selection now goes through the "Ecualizador" browsable folder (see
/// `seleccionarPresetEqPorMediaId` in `navegacion_auto.dart`, dispatched
/// from [playFromMediaId] below). Any other [name] is a no-op — never
/// throws.
@override
Future<dynamic> customAction(
String name, [
@@ -1192,8 +1189,6 @@ class PluriWaveAudioHandler extends BaseAudioHandler
switch (name) {
case accionEqToggle:
await setEcualizadorActivo(!_ecualizadorActivo);
case accionEqPresetSiguiente:
await aplicarPreset(presetSiguiente(_presetActual));
}
}