Phase 1: foundation modules
Central Config with all tunables (retention, GPS timeout, colors, event type keys, menu item metadata). Event / EventStore handle persistence via Application.Storage with 7-day pruning. Logger mirrors the same retention. LayoutMetrics and Haversine provide resolution-independent geometry helpers. German UI strings and placeholder menu icons landed alongside so the build stays green. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6f56c337f7
commit
43f970d764
19 changed files with 409 additions and 2 deletions
52
source/LayoutMetrics.mc
Normal file
52
source/LayoutMetrics.mc
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import Toybox.Graphics;
|
||||
import Toybox.Lang;
|
||||
|
||||
// Resolution-independent layout helpers. All sizes are computed as
|
||||
// fractions of the drawable context so the app adapts to any round
|
||||
// Garmin display.
|
||||
module LayoutMetrics {
|
||||
|
||||
// --- Menu ring geometry --------------------------------------------
|
||||
function centerX(dc as Dc) as Number { return dc.getWidth() / 2; }
|
||||
function centerY(dc as Dc) as Number { return dc.getHeight() / 2; }
|
||||
|
||||
// Radius on which the 10 icons sit.
|
||||
function ringRadius(dc as Dc) as Number {
|
||||
var min = (dc.getWidth() < dc.getHeight()) ? dc.getWidth() : dc.getHeight();
|
||||
return (min * 0.38).toNumber();
|
||||
}
|
||||
|
||||
function iconSize(dc as Dc) as Number {
|
||||
var min = (dc.getWidth() < dc.getHeight()) ? dc.getWidth() : dc.getHeight();
|
||||
return (min * 0.14).toNumber();
|
||||
}
|
||||
|
||||
function selectedIconSize(dc as Dc) as Number {
|
||||
return (iconSize(dc) * 1.3).toNumber();
|
||||
}
|
||||
|
||||
// --- History view sections -----------------------------------------
|
||||
function topSectionHeight(dc as Dc) as Number {
|
||||
return (dc.getHeight() * 0.15).toNumber();
|
||||
}
|
||||
|
||||
function midSectionHeight(dc as Dc) as Number {
|
||||
return (dc.getHeight() * 0.70).toNumber();
|
||||
}
|
||||
|
||||
function bottomSectionY(dc as Dc) as Number {
|
||||
return (dc.getHeight() * 0.85).toNumber();
|
||||
}
|
||||
|
||||
// --- Loading / delete arc radius ------------------------------------
|
||||
function edgeArcRadius(dc as Dc) as Number {
|
||||
var min = (dc.getWidth() < dc.getHeight()) ? dc.getWidth() : dc.getHeight();
|
||||
return (min * 0.48).toNumber();
|
||||
}
|
||||
|
||||
function edgeArcPenWidth(dc as Dc) as Number {
|
||||
var min = (dc.getWidth() < dc.getHeight()) ? dc.getWidth() : dc.getHeight();
|
||||
var w = (min * 0.025).toNumber();
|
||||
return (w < 3) ? 3 : w;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue