diff --git a/resources/properties.xml b/resources/properties.xml
new file mode 100644
index 0000000..13e5a00
--- /dev/null
+++ b/resources/properties.xml
@@ -0,0 +1,3 @@
+
+ false
+
diff --git a/resources/settings/settings.xml b/resources/settings/settings.xml
new file mode 100644
index 0000000..0c2398f
--- /dev/null
+++ b/resources/settings/settings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/resources/strings/strings.xml b/resources/strings/strings.xml
index cf50d8d..e42fb6b 100644
--- a/resources/strings/strings.xml
+++ b/resources/strings/strings.xml
@@ -1,3 +1,4 @@
Decimal Day
+ 5-Hour Mode
diff --git a/source/DecimalWatchFaceView.mc b/source/DecimalWatchFaceView.mc
index 1c52591..fbadeac 100644
--- a/source/DecimalWatchFaceView.mc
+++ b/source/DecimalWatchFaceView.mc
@@ -4,6 +4,7 @@ using Toybox.System;
using Toybox.Lang;
using Toybox.Time;
using Toybox.Time.Gregorian;
+using Toybox.Application;
class DecimalWatchFaceView extends WatchUi.WatchFace {
@@ -30,15 +31,31 @@ class DecimalWatchFaceView extends WatchUi.WatchFace {
var clockTime = System.getClockTime();
var decimalTime = computeDecimalTime(clockTime);
+ // Check if 5-hour mode is enabled
+ var useFiveHourMode = Application.Properties.getValue("UseFiveHourMode");
+ var displayTime = decimalTime;
+ var isMorning = true;
+
+ if (useFiveHourMode) {
+ // Convert 0-10 to 0-5 twice per day
+ if (decimalTime >= 5.0) {
+ displayTime = decimalTime - 5.0;
+ isMorning = false; // Afternoon
+ } else {
+ displayTime = decimalTime;
+ isMorning = true; // Morning
+ }
+ }
+
// Clear the screen
dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_BLACK);
dc.clear();
// Draw the watchface
- drawWatchFace(dc);
+ drawWatchFace(dc, useFiveHourMode, isMorning);
- // Draw the hand
- drawHand(dc, decimalTime);
+ // Draw the hands
+ drawHand(dc, displayTime, useFiveHourMode);
// Draw digital time display
drawDigitalTime(dc, decimalTime);
@@ -74,7 +91,7 @@ class DecimalWatchFaceView extends WatchUi.WatchFace {
}
// Draw the watchface circle, tick marks, and numbers
- function drawWatchFace(dc) {
+ function drawWatchFace(dc, useFiveHourMode, isMorning) {
var width = dc.getWidth();
var height = dc.getHeight();
var centerX = width / 2;
@@ -83,10 +100,14 @@ class DecimalWatchFaceView extends WatchUi.WatchFace {
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ // Determine scale based on mode (5 or 10 hour)
+ var maxValue = useFiveHourMode ? 5.0 : 10.0;
+ var tickCount = useFiveHourMode ? 50 : 100; // 0.1 intervals
+
// Draw tick marks at 0.1 intervals (major at whole numbers, minor at 0.1)
- for (var i = 0; i < 100; i++) {
+ for (var i = 0; i < tickCount; i++) {
var decimalValue = i * 0.1;
- var angle = (decimalValue / 10.0) * 360.0 - 90.0; // -90 to start at top
+ var angle = (decimalValue / maxValue) * 360.0 - 90.0; // -90 to start at top
var angleRad = Math.toRadians(angle);
// Determine if this is a major tick (whole number) or minor tick
@@ -108,9 +129,29 @@ class DecimalWatchFaceView extends WatchUi.WatchFace {
if (isMajor) {
var numberX = centerX + (radius - 38) * Math.cos(angleRad);
var numberY = centerY + (radius - 38) * Math.sin(angleRad);
- var numberValue = (i / 10).toNumber(); // Convert to 0-9
- if (numberValue == 0) {
- numberValue = 10; // Display 10 instead of 0
+ var numberValue = (i / 10).toNumber(); // Position 0-4 or 0-9
+
+ if (useFiveHourMode) {
+ // 5-hour mode: show different numbers based on morning/afternoon
+ if (isMorning) {
+ // Morning: show 5,1,2,3,4 (5 at top, then 1,2,3,4)
+ if (numberValue == 0) {
+ numberValue = 5;
+ }
+ // else numberValue stays as 1,2,3,4
+ } else {
+ // Afternoon: show 10,6,7,8,9 (10 at top, then 6,7,8,9)
+ if (numberValue == 0) {
+ numberValue = 10;
+ } else {
+ numberValue = numberValue + 5; // 1->6, 2->7, 3->8, 4->9
+ }
+ }
+ } else {
+ // 10-hour mode: show 10 at top instead of 0
+ if (numberValue == 0) {
+ numberValue = 10;
+ }
}
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
@@ -129,33 +170,37 @@ class DecimalWatchFaceView extends WatchUi.WatchFace {
}
// Draw hour, minute, and second hands for current decimal time
- function drawHand(dc, decimalTime) {
+ function drawHand(dc, decimalTime, useFiveHourMode) {
var width = dc.getWidth();
var height = dc.getHeight();
var centerX = width / 2;
var centerY = height / 2;
var radius = (width < height ? width : height) / 2 - 10;
- // Calculate hour hand (shows which decimal unit 0-9, one rotation per day)
- var hourAngle = (decimalTime / 10.0) * 360.0 - 90.0;
- var hourAngleRad = Math.toRadians(hourAngle);
+ // Adjust scale based on mode
+ var maxValue = useFiveHourMode ? 5.0 : 10.0;
+
+ // Calculate hour hand (shows which decimal unit)
+ // In 10-hour mode: one rotation per day
+ // In 5-hour mode: two rotations per day
+ var hourAngle = (decimalTime / maxValue) * 360.0 - 90.0;
var hourHandLength = radius - 70; // Shorter hand
- // Calculate minute hand (shows fractional part, 10 rotations per day)
+ // Calculate minute hand (shows fractional part)
var fractionalPart = decimalTime - decimalTime.toNumber(); // Get decimal part
var minuteAngle = fractionalPart * 360.0 - 90.0;
- var minuteAngleRad = Math.toRadians(minuteAngle);
var minuteHandLength = radius - 45; // Longer hand
- // Calculate second hand (shows finer detail, 100 rotations per day)
+ // Calculate second hand (shows finer detail)
// Only visible in high power mode
- var secondFractionalPart = (decimalTime * 10.0) - (decimalTime * 10.0).toNumber();
+ var multiplier = useFiveHourMode ? 5.0 : 10.0;
+ var secondFractionalPart = (decimalTime * multiplier) - (decimalTime * multiplier).toNumber();
var secondAngle = secondFractionalPart * 360.0 - 90.0;
var secondHandLength = radius - 35; // Longest hand
// Draw second hand first (if in high power mode), so it appears behind other hands
if (isHighPowerMode) {
- drawSingleHand(dc, centerX, centerY, secondAngle, secondHandLength, 2, Graphics.COLOR_DK_GRAY);
+ drawSingleHand(dc, centerX, centerY, secondAngle, secondHandLength, 2, Graphics.COLOR_YELLOW);
}
// Draw minute hand (longer, thinner)