diff --git a/lib/bluetooth/devices/shimano/shimano_di2.dart b/lib/bluetooth/devices/shimano/shimano_di2.dart index 999479ac..3cbf7445 100644 --- a/lib/bluetooth/devices/shimano/shimano_di2.dart +++ b/lib/bluetooth/devices/shimano/shimano_di2.dart @@ -918,7 +918,8 @@ class ShimanoDi2 extends BluetoothDevice { if (setupNeed == DeviceSetupNeed.setup) await _showSetup(context); } - /// The setup starts with the choice between E-TUBE channels and button mode. + /// The setup starts with the choice between E-TUBE channels, button mode and + /// the rider's own E-TUBE channels. /// However it was opened (Di2 card, checklist, or by itself), it counts as /// offered: the Di2 drops the link after a wrong passkey, and its reconnect /// must not open a second setup on top. @@ -931,6 +932,7 @@ class ShimanoDi2 extends BluetoothDevice { unawaited(switch (mode) { ShimanoSetupMode.channels => _showChannelSetup(context, afterChooser: true), ShimanoSetupMode.buttons => _showButtonModeSetup(context, afterChooser: true), + ShimanoSetupMode.etube => _showEtubeGuide(context, afterChooser: true), }); }, ); @@ -989,6 +991,14 @@ class ShimanoDi2 extends BluetoothDevice { ); } + /// The rider sets the D-Fly channels in the E-TUBE app; finished, BikeControl + /// uses them like after [useDflyChannels]. + Future _showEtubeGuide(BuildContext context, {bool afterChooser = false}) => showShimanoEtubeGuide( + context, + afterChooser: afterChooser, + onDone: () => unawaited(useDflyChannels()), + ); + Future _showRestore(BuildContext context) { final l = context.i18n; return showShimanoSetup( @@ -1029,6 +1039,7 @@ class ShimanoDi2 extends BluetoothDevice { onTurnOff: () => unawaited(turnOffButtonMode()), onSwitchToChannels: () => unawaited(_showChannelSetup(context)), onDismissWarning: () => unawaited(dismissButtonModeWarning()), + onShowEtubeGuide: () => unawaited(_showEtubeGuide(context)), ), ]; } diff --git a/lib/bluetooth/devices/shimano/shimano_setup_sheet.dart b/lib/bluetooth/devices/shimano/shimano_setup_sheet.dart index 3a75ad24..0106ac45 100644 --- a/lib/bluetooth/devices/shimano/shimano_setup_sheet.dart +++ b/lib/bluetooth/devices/shimano/shimano_setup_sheet.dart @@ -22,6 +22,10 @@ enum ShimanoSetupMode { /// Nothing is changed: while BikeControl is connected the Di2 doesn't shift /// and every press arrives as a button. A dropped link shifts for real. buttons, + + /// The rider assigns D-Fly channels in the E-TUBE app themselves, guided by + /// [showShimanoEtubeGuide]; BikeControl writes nothing to the Di2. + etube, } /// Asks how BikeControl should use the Di2 ([ShimanoSetupMode]) and hands the @@ -111,6 +115,17 @@ Widget shimanoModeChoiceBody( noteColor: _shimanoWarning, onTap: () => onSelect(ShimanoSetupMode.buttons), ), + const Gap(12), + _ShimanoModeOption( + selected: selected == ShimanoSetupMode.etube, + icon: LucideIcons.smartphone, + title: l.shimanoModeEtubeTitle, + body: l.shimanoModeEtubeBody, + note: l.shimanoModeEtubeNote, + noteIcon: LucideIcons.info, + noteColor: scheme.mutedForeground, + onTap: () => onSelect(ShimanoSetupMode.etube), + ), const Gap(24), Row( mainAxisAlignment: MainAxisAlignment.end, @@ -252,6 +267,257 @@ Widget _sheetFrame(BuildContext context, Widget body) => SafeArea( ), ); +/// The two pages of the E-TUBE guide: the steps in the app, then the check +/// that a press arrives. +enum ShimanoEtubeGuideStage { steps, check } + +/// Walks the rider through assigning D-Fly channels in the E-TUBE app +/// themselves. BikeControl writes nothing; [onDone] runs once the rider +/// finished, after the sheet has closed. [afterChooser] numbers the steps +/// after the mode choice. +Future showShimanoEtubeGuide( + BuildContext context, { + required VoidCallback onDone, + bool afterChooser = false, +}) async { + var done = false; + await openSheet( + context: context, + position: OverlayPosition.bottom, + barrierDismissible: false, + builder: (sheetContext) => _ShimanoEtubeGuide(afterChooser: afterChooser, onDone: () => done = true), + ); + if (done) onDone(); +} + +class _ShimanoEtubeGuide extends StatefulWidget { + final bool afterChooser; + final VoidCallback onDone; + const _ShimanoEtubeGuide({required this.afterChooser, required this.onDone}); + + @override + State<_ShimanoEtubeGuide> createState() => _ShimanoEtubeGuideState(); +} + +class _ShimanoEtubeGuideState extends State<_ShimanoEtubeGuide> { + var _stage = ShimanoEtubeGuideStage.steps; + + @override + Widget build(BuildContext context) => _sheetFrame( + context, + shimanoEtubeGuideBody( + context, + stage: _stage, + afterChooser: widget.afterChooser, + onClose: () => closeSheet(context), + onNext: () => setState(() => _stage = ShimanoEtubeGuideStage.check), + onDone: () { + widget.onDone(); + closeSheet(context); + }, + ), + ); +} + +/// The E-TUBE guide's content. Shared by the live sheet and the snapshot +/// harness so what tests capture is exactly what ships. +Widget shimanoEtubeGuideBody( + BuildContext context, { + required ShimanoEtubeGuideStage stage, + required VoidCallback onClose, + required VoidCallback onNext, + required VoidCallback onDone, + bool afterChooser = false, +}) { + final scheme = Theme.of(context).colorScheme; + final l = context.i18n; + final dark = Theme.of(context).brightness == Brightness.dark; + final reduceMotion = MediaQuery.of(context).disableAnimations; + final steps = stage == ShimanoEtubeGuideStage.steps; + final step = steps ? 1 : 2; + + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Gap(18), + afterChooser ? StepRail(step: step + 1, count: 3) : StepRail(step: step), + const Gap(18), + StageBadge( + icon: steps ? LucideIcons.smartphone : LucideIcons.hand, + tone: steps ? scheme.primary : _shimanoBlue, + wash: steps ? scheme.primary.withValues(alpha: 0.1) : (dark ? const Color(0x1A2563EB) : _shimanoBlueWash), + reduceMotion: reduceMotion, + ), + const Gap(16), + Text( + steps ? l.shimanoEtubeGuideTitle : l.shimanoEtubeCheckTitle, + style: context.typography.xLarge.copyWith(fontWeight: FontWeight.w700), + ), + const Gap(8), + Text( + steps ? l.shimanoEtubeGuideIntro : l.shimanoEtubeCheckBody, + style: context.typography.small.copyWith(height: 1.5, color: scheme.mutedForeground), + ), + const Gap(20), + if (steps) ...[ + _EtubeStep(number: 1, text: l.shimanoEtubeStepConnect), + const Gap(12), + _EtubeStep(number: 2, text: l.shimanoEtubeStepCustomize), + const Gap(12), + _EtubeStep(number: 3, text: l.shimanoEtubeStepAssign, child: const _EtubeChannelMap()), + const Gap(12), + _EtubeStep(number: 4, text: l.shimanoEtubeStepSave), + const Gap(16), + _EtubeNote(icon: LucideIcons.lightbulb, color: scheme.mutedForeground, text: l.shimanoEtubeHoodTip), + const Gap(8), + _EtubeNote(icon: LucideIcons.triangleAlert, color: _shimanoWarning, text: l.shimanoEtubeOutdoorWarning), + ] else + _EtubeNote(icon: LucideIcons.info, color: scheme.mutedForeground, text: l.shimanoEtubeCheckHint), + const Gap(24), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + GhostButton(onPressed: onClose, child: Text(l.cancel)), + const Gap(8), + if (steps) + PrimaryButton( + trailing: const Icon(LucideIcons.arrowRight, size: 16), + onPressed: onNext, + child: Text(l.shimanoEtubeDoneInApp), + ) + else + PrimaryButton(onPressed: onDone, child: Text(l.done)), + ], + ), + ], + ); +} + +class _EtubeStep extends StatelessWidget { + final int number; + final String text; + final Widget? child; + const _EtubeStep({required this.number, required this.text, this.child}); + + @override + Widget build(BuildContext context) { + final scheme = Theme.of(context).colorScheme; + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 24, + height: 24, + alignment: Alignment.center, + decoration: BoxDecoration(color: scheme.primary.withValues(alpha: 0.12), shape: BoxShape.circle), + child: Text( + '$number', + style: context.typography.xSmall.copyWith(fontWeight: FontWeight.w700, color: scheme.primary), + ), + ), + const Gap(12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Padding( + padding: const EdgeInsets.only(top: 3), + child: Text(text, style: context.typography.small.copyWith(height: 1.45)), + ), + if (child != null) ...[const Gap(10), child!], + ], + ), + ), + ], + ); + } +} + +/// Which paddle gets which channel: the mapping BikeControl's default actions +/// expect ([ShimanoDi2Buttons.channelActions]). +class _EtubeChannelMap extends StatelessWidget { + const _EtubeChannelMap(); + + @override + Widget build(BuildContext context) { + final scheme = Theme.of(context).colorScheme; + final l = context.i18n; + Widget side(String title, List<(String, String)> rows) => Expanded( + child: Container( + padding: const EdgeInsets.fromLTRB(12, 10, 12, 10), + decoration: BoxDecoration( + color: scheme.muted.withValues(alpha: 0.5), + borderRadius: BorderRadius.circular(10), + border: Border.all(color: scheme.border), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: context.typography.xSmall.copyWith(fontWeight: FontWeight.w700, color: scheme.mutedForeground), + ), + const Gap(6), + for (final (paddle, channel) in rows) + Padding( + padding: const EdgeInsets.symmetric(vertical: 2), + child: Row( + children: [ + Expanded(child: Text(paddle, style: context.typography.xSmall.copyWith(height: 1.3))), + const Gap(6), + Container( + padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 1), + decoration: ShapeDecoration(color: _shimanoChipDark, shape: const StadiumBorder()), + child: Text( + channel, + style: context.typography.xSmall.copyWith( + fontWeight: FontWeight.w700, + color: _shimanoWhite, + fontFeatures: const [FontFeature.tabularFigures()], + ), + ), + ), + ], + ), + ), + ], + ), + ), + ); + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + side(l.shimanoShifterLeft, [(l.shimanoEtubeShiftButton, 'Ch1'), (l.shimanoEtubeShiftLever, 'Ch2')]), + const Gap(10), + side(l.shimanoShifterRight, [(l.shimanoEtubeShiftButton, 'Ch3'), (l.shimanoEtubeShiftLever, 'Ch4')]), + ], + ); + } +} + +class _EtubeNote extends StatelessWidget { + final IconData icon; + final Color color; + final String text; + const _EtubeNote({required this.icon, required this.color, required this.text}); + + @override + Widget build(BuildContext context) => Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding: const EdgeInsets.only(top: 2), child: Icon(icon, size: 14, color: color)), + const Gap(6), + Expanded( + child: Text( + text, + style: context.typography.xSmall.copyWith(height: 1.4, fontWeight: FontWeight.w600, color: color), + ), + ), + ], + ); +} + /// Opens the staged setup sheet (authenticate → [operation]). [operation] /// runs with [initialPasskey] first and asks for the rider's own passkey only /// after the Di2 rejected it; the device supplies the error classifiers. @@ -314,7 +580,8 @@ Future showShimanoSetup( /// /// - nothing set up: what this is + "Use Di2 buttons" (opens the mode choice) /// - E-TUBE channels: active status + restore (when BikeControl changed the -/// switches) + change setup +/// switches) or the E-TUBE steps again (when the rider set them) + change +/// setup /// - button mode: active status + a one-time warning that a dropped link /// shifts for real + turn off Widget shimanoSetupPanel( @@ -328,6 +595,7 @@ Widget shimanoSetupPanel( required VoidCallback onTurnOff, required VoidCallback onSwitchToChannels, required VoidCallback onDismissWarning, + VoidCallback? onShowEtubeGuide, }) { final scheme = Theme.of(context).colorScheme; final l = context.i18n; @@ -425,6 +693,16 @@ Widget shimanoSetupPanel( Text(l.shimanoDflyActive, style: context.typography.small.copyWith(height: 1.4, color: scheme.mutedForeground)), const Gap(12), if (canRestore) ...[restore, const Gap(8)], + if (!canRestore && onShowEtubeGuide != null) ...[ + wide( + SecondaryButton( + leading: const Icon(LucideIcons.smartphone, size: 16), + onPressed: onShowEtubeGuide, + child: Text(l.shimanoEtubeShowSteps), + ), + ), + const Gap(8), + ], wide( SecondaryButton( leading: const Icon(LucideIcons.slidersHorizontal, size: 16), diff --git a/lib/i10n/intl_de.arb b/lib/i10n/intl_de.arb index 5496c806..d8b1cd6c 100644 --- a/lib/i10n/intl_de.arb +++ b/lib/i10n/intl_de.arb @@ -3055,5 +3055,23 @@ "@paywallBaseShiftNamed": {"placeholders": {"app": {"type": "String"}}}, "paywallBaseShiftNamedNative": "{app} schaltet mit den eigenen Gängen.", "@paywallBaseShiftNamedNative": {"placeholders": {"app": {"type": "String"}}}, - "paywallBaseShift": "Deine Trainer-App schaltet mit ihren eigenen Gängen und fühlt sich womöglich weniger direkt an." + "paywallBaseShift": "Deine Trainer-App schaltet mit ihren eigenen Gängen und fühlt sich womöglich weniger direkt an.", + "shimanoModeEtubeTitle": "Selbst in E-TUBE einrichten", + "shimanoModeEtubeBody": "BikeControl ändert nichts an deiner Di2. Du legst deine Tasten Schritt für Schritt in Shimanos E-TUBE-PROJECT-App auf D-Fly-Kanäle, und BikeControl nutzt sie.", + "shimanoModeEtubeNote": "Nimm die Tasten oben am Griff, dann schalten deine Hebel weiter.", + "shimanoEtubeGuideTitle": "D-Fly-Kanäle in E-TUBE festlegen", + "shimanoEtubeGuideIntro": "Das machst du einmal in der Shimano-App E-TUBE PROJECT Cyclist auf deinem Handy. Tasten auf einem D-Fly-Kanal werden zu BikeControl-Tasten.", + "shimanoEtubeStepConnect": "Öffne E-TUBE PROJECT Cyclist und verbinde dein Rad. Findet die App deine Di2 nicht, schließ BikeControl kurz.", + "shimanoEtubeStepCustomize": "Tippe auf „Anpassen“ und dann auf die Einstellungen der Schalterfunktionen.", + "shimanoEtubeStepAssign": "Lege jede Taste, die du nutzen willst, auf einen D-FLY-Kanal. Mit diesen Kanälen passen BikeControls Standardaktionen zu deinem Schalten:", + "shimanoEtubeStepSave": "Speichere die Einstellung in E-TUBE und komm dann zurück zu BikeControl.", + "shimanoEtubeShiftButton": "Schalttaste", + "shimanoEtubeShiftLever": "Schalthebel", + "shimanoEtubeHoodTip": "Tipp: Leg die Kanäle stattdessen auf die Tasten oben am Griff, dann schalten deine Hebel deine Di2 weiter.", + "shimanoEtubeOutdoorWarning": "Hebel auf einem D-Fly-Kanal schalten deine Di2 nicht, auch draußen nicht. Stell sie in E-TUBE zurück, bevor du draußen fährst.", + "shimanoEtubeDoneInApp": "In E-TUBE erledigt", + "shimanoEtubeCheckTitle": "Drück eine Taste zum Prüfen", + "shimanoEtubeCheckBody": "Drück eine Taste, die du auf einen D-Fly-Kanal gelegt hast. Sie erscheint auf der Di2-Karte, bereit für eine Aktion.", + "shimanoEtubeCheckHint": "Es erscheint nichts? Prüf, ob du die Einstellung in E-TUBE gespeichert hast, und schließ die E-TUBE-App, damit sich BikeControl mit deiner Di2 verbinden kann.", + "shimanoEtubeShowSteps": "E-TUBE-Schritte anzeigen" } diff --git a/lib/i10n/intl_en.arb b/lib/i10n/intl_en.arb index 3b02bcab..e3d2d776 100644 --- a/lib/i10n/intl_en.arb +++ b/lib/i10n/intl_en.arb @@ -3501,5 +3501,23 @@ "@paywallBaseShiftNamed": {"placeholders": {"app": {"type": "String"}}}, "paywallBaseShiftNamedNative": "{app} does the shifting with its own gears.", "@paywallBaseShiftNamedNative": {"placeholders": {"app": {"type": "String"}}}, - "paywallBaseShift": "Your trainer app does the shifting with its own gears and might not feel as snappy." + "paywallBaseShift": "Your trainer app does the shifting with its own gears and might not feel as snappy.", + "shimanoModeEtubeTitle": "Set it up in E-TUBE myself", + "shimanoModeEtubeBody": "BikeControl changes nothing on your Di2. You assign D-Fly channels to your buttons in Shimano's E-TUBE PROJECT app, step by step, and BikeControl uses them.", + "shimanoModeEtubeNote": "Use the hood buttons and your paddles keep shifting.", + "shimanoEtubeGuideTitle": "Set D-Fly channels in E-TUBE", + "shimanoEtubeGuideIntro": "Do this once in the Shimano E-TUBE PROJECT Cyclist app on your phone. Buttons on a D-Fly channel become BikeControl buttons.", + "shimanoEtubeStepConnect": "Open E-TUBE PROJECT Cyclist and connect your bike. If it doesn't find your Di2, close BikeControl for a moment.", + "shimanoEtubeStepCustomize": "Tap Customize, then the switch function settings.", + "shimanoEtubeStepAssign": "Set each button you want to use to a D-FLY channel. With these channels, BikeControl's default actions match your shifting:", + "shimanoEtubeStepSave": "Save the setting in E-TUBE, then come back to BikeControl.", + "shimanoEtubeShiftButton": "Shift button", + "shimanoEtubeShiftLever": "Shift lever", + "shimanoEtubeHoodTip": "Tip: put the channels on your hood buttons instead and your paddles keep shifting your Di2.", + "shimanoEtubeOutdoorWarning": "Paddles on a D-Fly channel don't shift your Di2, outdoors too. Set them back in E-TUBE before you ride outside.", + "shimanoEtubeDoneInApp": "Done in E-TUBE", + "shimanoEtubeCheckTitle": "Press a button to check", + "shimanoEtubeCheckBody": "Press a button you set to a D-Fly channel. It shows up on the Di2 card, ready for an action.", + "shimanoEtubeCheckHint": "Nothing shows up? Make sure you saved the setting in E-TUBE and close the E-TUBE app, so BikeControl can connect to your Di2.", + "shimanoEtubeShowSteps": "Show the E-TUBE steps" } diff --git a/lib/i10n/intl_es.arb b/lib/i10n/intl_es.arb index b6ec768c..8d9d0d04 100644 --- a/lib/i10n/intl_es.arb +++ b/lib/i10n/intl_es.arb @@ -3055,5 +3055,23 @@ "@paywallBaseShiftNamed": {"placeholders": {"app": {"type": "String"}}}, "paywallBaseShiftNamedNative": "{app} cambia con sus propias marchas.", "@paywallBaseShiftNamedNative": {"placeholders": {"app": {"type": "String"}}}, - "paywallBaseShift": "Tu app de entrenamiento cambia con sus propias marchas y puede sentirse menos ágil." + "paywallBaseShift": "Tu app de entrenamiento cambia con sus propias marchas y puede sentirse menos ágil.", + "shimanoModeEtubeTitle": "Configurarlo yo en E-TUBE", + "shimanoModeEtubeBody": "BikeControl no cambia nada en tu Di2. Asignas canales D-Fly a tus botones en la app E-TUBE PROJECT de Shimano, paso a paso, y BikeControl los usa.", + "shimanoModeEtubeNote": "Usa los botones de las manetas y tus palancas seguirán cambiando.", + "shimanoEtubeGuideTitle": "Asignar canales D-Fly en E-TUBE", + "shimanoEtubeGuideIntro": "Hazlo una vez en la app Shimano E-TUBE PROJECT Cyclist de tu móvil. Los botones en un canal D-Fly se convierten en botones de BikeControl.", + "shimanoEtubeStepConnect": "Abre E-TUBE PROJECT Cyclist y conecta tu bici. Si no encuentra tu Di2, cierra BikeControl un momento.", + "shimanoEtubeStepCustomize": "Toca Personalizar y luego los ajustes de función de los interruptores.", + "shimanoEtubeStepAssign": "Asigna cada botón que quieras usar a un canal D-FLY. Con estos canales, las acciones predeterminadas de BikeControl coinciden con tu forma de cambiar:", + "shimanoEtubeStepSave": "Guarda el ajuste en E-TUBE y vuelve a BikeControl.", + "shimanoEtubeShiftButton": "Botón de cambio", + "shimanoEtubeShiftLever": "Palanca de cambio", + "shimanoEtubeHoodTip": "Consejo: pon los canales en los botones de las manetas y tus palancas seguirán cambiando tu Di2.", + "shimanoEtubeOutdoorWarning": "Las palancas en un canal D-Fly no cambian tu Di2, tampoco en exterior. Vuelve a ajustarlas en E-TUBE antes de rodar fuera.", + "shimanoEtubeDoneInApp": "Hecho en E-TUBE", + "shimanoEtubeCheckTitle": "Pulsa un botón para comprobarlo", + "shimanoEtubeCheckBody": "Pulsa un botón que hayas asignado a un canal D-Fly. Aparece en la tarjeta del Di2, listo para una acción.", + "shimanoEtubeCheckHint": "¿No aparece nada? Comprueba que guardaste el ajuste en E-TUBE y cierra la app E-TUBE para que BikeControl pueda conectarse a tu Di2.", + "shimanoEtubeShowSteps": "Ver los pasos de E-TUBE" } diff --git a/lib/i10n/intl_fr.arb b/lib/i10n/intl_fr.arb index 3039f204..2505350f 100644 --- a/lib/i10n/intl_fr.arb +++ b/lib/i10n/intl_fr.arb @@ -3055,5 +3055,23 @@ "@paywallBaseShiftNamed": {"placeholders": {"app": {"type": "String"}}}, "paywallBaseShiftNamedNative": "{app} passe les vitesses avec les siennes.", "@paywallBaseShiftNamedNative": {"placeholders": {"app": {"type": "String"}}}, - "paywallBaseShift": "Ton appli d'entraînement passe les vitesses avec les siennes et peut sembler moins réactive." + "paywallBaseShift": "Ton appli d'entraînement passe les vitesses avec les siennes et peut sembler moins réactive.", + "shimanoModeEtubeTitle": "Le configurer moi-même dans E-TUBE", + "shimanoModeEtubeBody": "BikeControl ne modifie rien sur ton Di2. Tu attribues des canaux D-Fly à tes boutons dans l'app E-TUBE PROJECT de Shimano, étape par étape, et BikeControl les utilise.", + "shimanoModeEtubeNote": "Utilise les boutons sur les cocottes et tes leviers continuent de passer les vitesses.", + "shimanoEtubeGuideTitle": "Attribuer les canaux D-Fly dans E-TUBE", + "shimanoEtubeGuideIntro": "À faire une fois dans l'app Shimano E-TUBE PROJECT Cyclist sur ton téléphone. Les boutons sur un canal D-Fly deviennent des boutons BikeControl.", + "shimanoEtubeStepConnect": "Ouvre E-TUBE PROJECT Cyclist et connecte ton vélo. S'il ne trouve pas ton Di2, ferme BikeControl un instant.", + "shimanoEtubeStepCustomize": "Touche Personnaliser, puis les réglages de fonction des commandes.", + "shimanoEtubeStepAssign": "Attribue chaque bouton que tu veux utiliser à un canal D-FLY. Avec ces canaux, les actions par défaut de BikeControl suivent ta façon de passer les vitesses :", + "shimanoEtubeStepSave": "Enregistre le réglage dans E-TUBE, puis reviens dans BikeControl.", + "shimanoEtubeShiftButton": "Bouton de vitesse", + "shimanoEtubeShiftLever": "Levier de vitesse", + "shimanoEtubeHoodTip": "Astuce : mets plutôt les canaux sur les boutons des cocottes, tes leviers continuent alors de passer les vitesses.", + "shimanoEtubeOutdoorWarning": "Les leviers sur un canal D-Fly ne passent pas les vitesses de ton Di2, dehors non plus. Remets-les dans E-TUBE avant de rouler dehors.", + "shimanoEtubeDoneInApp": "Fait dans E-TUBE", + "shimanoEtubeCheckTitle": "Appuie sur un bouton pour vérifier", + "shimanoEtubeCheckBody": "Appuie sur un bouton que tu as mis sur un canal D-Fly. Il apparaît sur la carte Di2, prêt pour une action.", + "shimanoEtubeCheckHint": "Rien n'apparaît ? Vérifie que tu as enregistré le réglage dans E-TUBE et ferme l'app E-TUBE pour que BikeControl puisse se connecter à ton Di2.", + "shimanoEtubeShowSteps": "Voir les étapes E-TUBE" } diff --git a/lib/i10n/intl_it.arb b/lib/i10n/intl_it.arb index ec904b51..475b542c 100644 --- a/lib/i10n/intl_it.arb +++ b/lib/i10n/intl_it.arb @@ -3055,5 +3055,23 @@ "@paywallBaseShiftNamed": {"placeholders": {"app": {"type": "String"}}}, "paywallBaseShiftNamedNative": "{app} cambia con le sue marce.", "@paywallBaseShiftNamedNative": {"placeholders": {"app": {"type": "String"}}}, - "paywallBaseShift": "La tua app di allenamento cambia con le sue marce e può sembrare meno reattiva." + "paywallBaseShift": "La tua app di allenamento cambia con le sue marce e può sembrare meno reattiva.", + "shimanoModeEtubeTitle": "Lo configuro io in E-TUBE", + "shimanoModeEtubeBody": "BikeControl non modifica nulla sulla tua Di2. Assegni i canali D-Fly ai tuoi pulsanti nell'app E-TUBE PROJECT di Shimano, passo dopo passo, e BikeControl li usa.", + "shimanoModeEtubeNote": "Usa i pulsanti sui comandi e le leve continuano a cambiare.", + "shimanoEtubeGuideTitle": "Imposta i canali D-Fly in E-TUBE", + "shimanoEtubeGuideIntro": "Da fare una volta nell'app Shimano E-TUBE PROJECT Cyclist sul telefono. I pulsanti su un canale D-Fly diventano pulsanti di BikeControl.", + "shimanoEtubeStepConnect": "Apri E-TUBE PROJECT Cyclist e collega la bici. Se non trova la tua Di2, chiudi BikeControl per un momento.", + "shimanoEtubeStepCustomize": "Tocca Personalizza, poi le impostazioni di funzione dei comandi.", + "shimanoEtubeStepAssign": "Assegna ogni pulsante che vuoi usare a un canale D-FLY. Con questi canali, le azioni predefinite di BikeControl seguono il tuo modo di cambiare:", + "shimanoEtubeStepSave": "Salva l'impostazione in E-TUBE, poi torna a BikeControl.", + "shimanoEtubeShiftButton": "Pulsante cambio", + "shimanoEtubeShiftLever": "Leva cambio", + "shimanoEtubeHoodTip": "Consiglio: metti i canali sui pulsanti dei comandi, così le leve continuano a cambiare la tua Di2.", + "shimanoEtubeOutdoorWarning": "Le leve su un canale D-Fly non cambiano la tua Di2, nemmeno all'aperto. Reimpostale in E-TUBE prima di uscire in strada.", + "shimanoEtubeDoneInApp": "Fatto in E-TUBE", + "shimanoEtubeCheckTitle": "Premi un pulsante per verificare", + "shimanoEtubeCheckBody": "Premi un pulsante che hai messo su un canale D-Fly. Compare sulla scheda Di2, pronto per un'azione.", + "shimanoEtubeCheckHint": "Non compare nulla? Verifica di aver salvato l'impostazione in E-TUBE e chiudi l'app E-TUBE, così BikeControl può collegarsi alla tua Di2.", + "shimanoEtubeShowSteps": "Mostra i passaggi E-TUBE" } diff --git a/lib/i10n/intl_pl.arb b/lib/i10n/intl_pl.arb index 723f9db8..2a6f46eb 100644 --- a/lib/i10n/intl_pl.arb +++ b/lib/i10n/intl_pl.arb @@ -3055,5 +3055,23 @@ "@paywallBaseShiftNamed": {"placeholders": {"app": {"type": "String"}}}, "paywallBaseShiftNamedNative": "{app} zmienia biegi po swojemu.", "@paywallBaseShiftNamedNative": {"placeholders": {"app": {"type": "String"}}}, - "paywallBaseShift": "Aplikacja treningowa zmienia biegi po swojemu i może działać mniej żwawo." + "paywallBaseShift": "Aplikacja treningowa zmienia biegi po swojemu i może działać mniej żwawo.", + "shimanoModeEtubeTitle": "Ustawię to sam w E-TUBE", + "shimanoModeEtubeBody": "BikeControl niczego nie zmienia w Twoim Di2. Krok po kroku przypisujesz przyciskom kanały D-Fly w aplikacji Shimano E-TUBE PROJECT, a BikeControl z nich korzysta.", + "shimanoModeEtubeNote": "Użyj przycisków na klamkomanetkach, a dźwignie dalej będą zmieniać biegi.", + "shimanoEtubeGuideTitle": "Ustaw kanały D-Fly w E-TUBE", + "shimanoEtubeGuideIntro": "Zrób to raz w aplikacji Shimano E-TUBE PROJECT Cyclist na telefonie. Przyciski na kanale D-Fly stają się przyciskami BikeControl.", + "shimanoEtubeStepConnect": "Otwórz E-TUBE PROJECT Cyclist i połącz rower. Jeśli aplikacja nie znajduje Di2, zamknij na chwilę BikeControl.", + "shimanoEtubeStepCustomize": "Stuknij Dostosuj, a potem ustawienia funkcji przełączników.", + "shimanoEtubeStepAssign": "Przypisz każdy przycisk, którego chcesz używać, do kanału D-FLY. Z tymi kanałami domyślne akcje BikeControl pasują do Twojej zmiany biegów:", + "shimanoEtubeStepSave": "Zapisz ustawienie w E-TUBE i wróć do BikeControl.", + "shimanoEtubeShiftButton": "Przycisk zmiany", + "shimanoEtubeShiftLever": "Dźwignia zmiany", + "shimanoEtubeHoodTip": "Wskazówka: przypisz kanały do przycisków na klamkomanetkach, a dźwignie dalej będą zmieniać biegi w Di2.", + "shimanoEtubeOutdoorWarning": "Dźwignie na kanale D-Fly nie zmieniają biegów w Di2, także na zewnątrz. Przywróć je w E-TUBE przed jazdą na zewnątrz.", + "shimanoEtubeDoneInApp": "Gotowe w E-TUBE", + "shimanoEtubeCheckTitle": "Naciśnij przycisk, by sprawdzić", + "shimanoEtubeCheckBody": "Naciśnij przycisk przypisany do kanału D-Fly. Pojawi się na karcie Di2, gotowy na akcję.", + "shimanoEtubeCheckHint": "Nic się nie pojawia? Sprawdź, czy zapisałeś ustawienie w E-TUBE, i zamknij aplikację E-TUBE, aby BikeControl mógł połączyć się z Di2.", + "shimanoEtubeShowSteps": "Pokaż kroki E-TUBE" } diff --git a/lib/i10n/intl_zh.arb b/lib/i10n/intl_zh.arb index 05cf28c8..5e3e8c5e 100644 --- a/lib/i10n/intl_zh.arb +++ b/lib/i10n/intl_zh.arb @@ -4237,5 +4237,23 @@ "@paywallBaseShiftNamed": {"placeholders": {"app": {"type": "String"}}}, "paywallBaseShiftNamedNative": "{app} 用它自己的挡位换挡。", "@paywallBaseShiftNamedNative": {"placeholders": {"app": {"type": "String"}}}, - "paywallBaseShift": "骑行软件用它自己的挡位换挡,可能不那么灵敏。" + "paywallBaseShift": "骑行软件用它自己的挡位换挡,可能不那么灵敏。", + "shimanoModeEtubeTitle": "我自己在 E-TUBE 中设置", + "shimanoModeEtubeBody": "BikeControl 不会更改你的 Di2。你按步骤在 Shimano 的 E-TUBE PROJECT 应用中把按键设为 D-Fly 通道,BikeControl 即可使用它们。", + "shimanoModeEtubeNote": "使用手柄顶部按键,你的拨杆仍可正常换挡。", + "shimanoEtubeGuideTitle": "在 E-TUBE 中设置 D-Fly 通道", + "shimanoEtubeGuideIntro": "在手机上的 Shimano E-TUBE PROJECT Cyclist 应用中设置一次即可。设为 D-Fly 通道的按键会成为 BikeControl 按键。", + "shimanoEtubeStepConnect": "打开 E-TUBE PROJECT Cyclist 并连接你的自行车。如果找不到 Di2,请暂时关闭 BikeControl。", + "shimanoEtubeStepCustomize": "点击“自定义”,然后进入开关功能设置。", + "shimanoEtubeStepAssign": "把你想用的每个按键设为一个 D-FLY 通道。使用以下通道,BikeControl 的默认动作与你的换挡方式一致:", + "shimanoEtubeStepSave": "在 E-TUBE 中保存设置,然后回到 BikeControl。", + "shimanoEtubeShiftButton": "换挡按键", + "shimanoEtubeShiftLever": "换挡拨杆", + "shimanoEtubeHoodTip": "提示:把通道设在手柄顶部按键上,你的拨杆仍可为 Di2 换挡。", + "shimanoEtubeOutdoorWarning": "设为 D-Fly 通道的拨杆不会为 Di2 换挡,户外也一样。户外骑行前请在 E-TUBE 中改回。", + "shimanoEtubeDoneInApp": "已在 E-TUBE 中完成", + "shimanoEtubeCheckTitle": "按一个按键检查", + "shimanoEtubeCheckBody": "按一个你设为 D-Fly 通道的按键。它会出现在 Di2 卡片上,可分配动作。", + "shimanoEtubeCheckHint": "没有出现?请确认已在 E-TUBE 中保存设置,并关闭 E-TUBE 应用,以便 BikeControl 连接你的 Di2。", + "shimanoEtubeShowSteps": "查看 E-TUBE 步骤" } diff --git a/test/shimano_states_snapshot_test.dart b/test/shimano_states_snapshot_test.dart index 3426c1ca..9d53a923 100644 --- a/test/shimano_states_snapshot_test.dart +++ b/test/shimano_states_snapshot_test.dart @@ -19,7 +19,7 @@ import 'widget_snapshot.dart'; Future main() async { await ensureSnapshotHarness(); - const locales = ['en']; + const locales = ['en', 'de']; Widget sheet(Widget body) => Card( child: Padding(padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16), child: body), @@ -31,6 +31,7 @@ Future main() async { bool channels = false, bool canRestore = false, bool warning = false, + bool etubeGuide = false, }) => Card( child: shimanoSetupPanel( @@ -44,6 +45,7 @@ Future main() async { onTurnOff: () {}, onSwitchToChannels: () {}, onDismissWarning: () {}, + onShowEtubeGuide: etubeGuide ? () {} : null, ), ); @@ -142,6 +144,30 @@ Future main() async { 'di2_14_panel_button_mode_warning': (380, true, (c) => panel(c, buttonMode: true, warning: true)), 'di2_15_panel_button_mode': (380, true, (c) => panel(c, buttonMode: true)), 'di2_16_panel_dfly_from_etube': (380, true, (c) => panel(c, channels: true)), + 'di2_18_choose_mode_etube': (440, true, (c) => sheet(shimanoModeChoiceBody( + c, + selected: ShimanoSetupMode.etube, + onSelect: (_) {}, + onClose: () {}, + onContinue: () {}, + ))), + 'di2_19_etube_guide_steps': (440, true, (c) => sheet(shimanoEtubeGuideBody( + c, + stage: ShimanoEtubeGuideStage.steps, + afterChooser: true, + onClose: () {}, + onNext: () {}, + onDone: () {}, + ))), + 'di2_20_etube_guide_check': (440, true, (c) => sheet(shimanoEtubeGuideBody( + c, + stage: ShimanoEtubeGuideStage.check, + afterChooser: true, + onClose: () {}, + onNext: () {}, + onDone: () {}, + ))), + 'di2_21_panel_dfly_from_etube_guide': (380, true, (c) => panel(c, channels: true, etubeGuide: true)), 'di2_17_wake_your_di2': (440, false, (c) => channelsBody(c, ShimanoSetupStage.authorize)), };