diff --git a/resources/properties.xml b/resources/properties.xml index 13e5a00..8574af9 100644 --- a/resources/properties.xml +++ b/resources/properties.xml @@ -1,3 +1,5 @@ false + false + true diff --git a/resources/settings/settings.xml b/resources/settings/settings.xml index 0c2398f..03126d3 100644 --- a/resources/settings/settings.xml +++ b/resources/settings/settings.xml @@ -2,4 +2,10 @@ + + + + + + diff --git a/resources/strings/strings.xml b/resources/strings/strings.xml index e42fb6b..1e38a66 100644 --- a/resources/strings/strings.xml +++ b/resources/strings/strings.xml @@ -1,4 +1,6 @@ Decimal Day 5-Hour Mode + 12 Hour Shadow + Show Numeric Time diff --git a/source/DecimalWatchFaceView.mc b/source/DecimalWatchFaceView.mc index fbadeac..93a177a 100644 --- a/source/DecimalWatchFaceView.mc +++ b/source/DecimalWatchFaceView.mc @@ -31,8 +31,10 @@ class DecimalWatchFaceView extends WatchUi.WatchFace { var clockTime = System.getClockTime(); var decimalTime = computeDecimalTime(clockTime); - // Check if 5-hour mode is enabled + // Check settings var useFiveHourMode = Application.Properties.getValue("UseFiveHourMode"); + var show12HourShadow = Application.Properties.getValue("Show12HourShadow"); + var showNumericTime = Application.Properties.getValue("ShowNumericTime"); var displayTime = decimalTime; var isMorning = true; @@ -55,10 +57,18 @@ class DecimalWatchFaceView extends WatchUi.WatchFace { drawWatchFace(dc, useFiveHourMode, isMorning); // Draw the hands - drawHand(dc, displayTime, useFiveHourMode); + drawHand(dc, displayTime, useFiveHourMode, show12HourShadow, clockTime); - // Draw digital time display - drawDigitalTime(dc, decimalTime); + // Draw digital time displays + if (showNumericTime) { + // Draw decimal time at bottom + drawDigitalTime(dc, decimalTime); + + // If 12-hour shadow is also enabled, draw traditional time at top + if (show12HourShadow) { + drawTraditionalTime(dc, clockTime); + } + } } // Called when this View is removed from the screen. Save the @@ -170,13 +180,33 @@ class DecimalWatchFaceView extends WatchUi.WatchFace { } // Draw hour, minute, and second hands for current decimal time - function drawHand(dc, decimalTime, useFiveHourMode) { + function drawHand(dc, decimalTime, useFiveHourMode, show12HourShadow, clockTime) { var width = dc.getWidth(); var height = dc.getHeight(); var centerX = width / 2; var centerY = height / 2; var radius = (width < height ? width : height) / 2 - 10; + // Draw traditional 12-hour shadow hands first (if enabled), so they appear behind + if (show12HourShadow) { + var hour = clockTime.hour; + var minute = clockTime.min; + + // Calculate traditional 12-hour hand angle + var traditional12HourAngle = ((hour % 12) + (minute / 60.0)) / 12.0 * 360.0 - 90.0; + var traditional12HourLength = radius - 70; // Same as decimal hour hand + + // Calculate traditional 60-minute hand angle + var traditional60MinuteAngle = (minute / 60.0) * 360.0 - 90.0; + var traditional60MinuteLength = radius - 45; // Same as decimal minute hand + + // Draw traditional minute hand (dark gray) + drawSingleHand(dc, centerX, centerY, traditional60MinuteAngle, traditional60MinuteLength, 4, Graphics.COLOR_DK_GRAY); + + // Draw traditional hour hand (dark red) + drawSingleHand(dc, centerX, centerY, traditional12HourAngle, traditional12HourLength, 6, Graphics.COLOR_DK_RED); + } + // Adjust scale based on mode var maxValue = useFiveHourMode ? 5.0 : 10.0; @@ -258,4 +288,32 @@ class DecimalWatchFaceView extends WatchUi.WatchFace { Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER ); } + + // Draw traditional 12-hour time display + function drawTraditionalTime(dc, clockTime) { + var width = dc.getWidth(); + var height = dc.getHeight(); + + var hour = clockTime.hour; + var minute = clockTime.min; + + // Convert to 12-hour format + var hour12 = hour % 12; + if (hour12 == 0) { + hour12 = 12; + } + + // Format as HH:MM + var timeString = hour12.format("%d") + ":" + minute.format("%02d"); + + // Draw at top center in dark gray + dc.setColor(Graphics.COLOR_DK_GRAY, Graphics.COLOR_TRANSPARENT); + dc.drawText( + width / 2, + height * 0.25, + Graphics.FONT_LARGE, + timeString, + Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER + ); + } }