Phase 3: event creation flow (GPS + success / error)

GpsService runs a single-shot position request with a hard timeout
and early-exit when Config.GPS_TARGET_ACCURACY_M is reached.
LoadingView renders a circular progress bar around the edge plus the
"Standort wird bestimmt" prompt; on callback it persists a new Event
via EventStore.add and transitions to SuccessView (green checkmark,
short vibration, auto-close) or ErrorView (red alert, 3× vibration,
German message, longer hold). TextUtils extracts the shared
multi-line centered text rendering so MenuView, LoadingView and
ErrorView all render wrapped German text consistently. Positioning
permission added to manifest.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
EiSiMo 2026-04-11 20:36:22 +02:00
parent d3494acc0d
commit 025d3007db
9 changed files with 332 additions and 17 deletions

View file

@ -1,9 +1,9 @@
import Toybox.Lang;
import Toybox.WatchUi;
// Routes menu input. UP/DOWN rotate the ring; START/STOP selects.
// Dispatch of event-type keys is wired up in later phases for now
// each selection just logs and no-ops.
// Routes menu input. UP/DOWN rotate the ring. START/STOP dispatches:
// - event types (arrest, start, ) push the GPS LoadingView
// - history / delete are stubbed until later phases
class MenuDelegate extends WatchUi.BehaviorDelegate {
private var _view as MenuView;
@ -25,7 +25,18 @@ class MenuDelegate extends WatchUi.BehaviorDelegate {
function onSelect() as Boolean {
var item = _view.selectedItem();
Logger.log("menu.select: " + (item[:key] as String));
var key = item[:key] as String;
if (key.equals(Config.ACTION_HISTORY)) {
// Phase 4
return true;
}
if (key.equals(Config.ACTION_DELETE)) {
// Phase 5
return true;
}
WatchUi.pushView(new LoadingView(key), null, WatchUi.SLIDE_IMMEDIATE);
return true;
}
}