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>
42 lines
1 KiB
MonkeyC
42 lines
1 KiB
MonkeyC
import Toybox.Lang;
|
|
import Toybox.WatchUi;
|
|
|
|
// 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;
|
|
|
|
function initialize(view as MenuView) {
|
|
BehaviorDelegate.initialize();
|
|
_view = view;
|
|
}
|
|
|
|
function onNextPage() as Boolean {
|
|
_view.rotateNext();
|
|
return true;
|
|
}
|
|
|
|
function onPreviousPage() as Boolean {
|
|
_view.rotatePrev();
|
|
return true;
|
|
}
|
|
|
|
function onSelect() as Boolean {
|
|
var item = _view.selectedItem();
|
|
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;
|
|
}
|
|
}
|