diff options
Diffstat (limited to 'spike/settings/source/SpikeApp.mc')
| -rw-r--r-- | spike/settings/source/SpikeApp.mc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/spike/settings/source/SpikeApp.mc b/spike/settings/source/SpikeApp.mc new file mode 100644 index 0000000..c5adcb2 --- /dev/null +++ b/spike/settings/source/SpikeApp.mc @@ -0,0 +1,43 @@ +// Author: cirakg & claude ai +// Summary: Settings spike entry point: analyses every setting on start and on each change, and writes a status back. +// +// The spike measures what Garmin doesn't document (README section 16, M1): +// how long a text setting may be, which characters survive, whether values +// the watch writes back reach the phone, and when onSettingsChanged fires. +// It is a throwaway app with its own app id; nothing here is reused by OTP +// Wallet except the measured numbers. + +import Toybox.Application; +import Toybox.Lang; +import Toybox.WatchUi; + +class SpikeApp extends Application.AppBase { + + // The analysis shown on screen, refreshed on start and on every change. + var report as SpikeReport; + + function initialize() { + AppBase.initialize(); + report = new SpikeReport(); + } + + // Read the values the watch already has (from the last sync). + function onStart(state as Dictionary?) as Void { + report.analyseOnStart(); + DebugSelfTest.run(self); + } + + function onStop(state as Dictionary?) as Void { + } + + function getInitialView() as [Views] or [Views, InputDelegates] { + var view = new SpikeView(report); + return [view, new SpikeDelegate(view)]; + } + + // Called when you save the settings on the phone while the app runs. + function onSettingsChanged() as Void { + report.settingsChanged(); + WatchUi.requestUpdate(); + } +} |
