Fixed FR165 support

Removed value text shadow for readability
This commit is contained in:
Mark van Renswoude 2024-11-15 14:29:03 +01:00
parent 4df963cedf
commit 277f213693
4 changed files with 31 additions and 18 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@ KittieCats/resources/drawables/background_xmas.jpg
# Build artifacts # Build artifacts
bin bin
build

View File

@ -14,6 +14,7 @@
"Monkey C: Edit Products" - Lets you add or remove any product "Monkey C: Edit Products" - Lets you add or remove any product
--> -->
<iq:products> <iq:products>
<iq:product id="fr165"/>
<iq:product id="vivoactive5"/> <iq:product id="vivoactive5"/>
</iq:products> </iq:products>
<!-- <!--

View File

@ -4,11 +4,11 @@
<bitmap id="Background" filename="background.jpg" /> <bitmap id="Background" filename="background.jpg" />
<bitmap id="BackgroundXmas" filename="background_xmas.jpg" /> <bitmap id="BackgroundXmas" filename="background_xmas.jpg" />
<bitmap id="Ticks" filename="ticks.svg" packingFormat="png" /> <bitmap id="Ticks" filename="ticks.svg" automaticPalette="false" />
<bitmap id="ArmHour" filename="arm_hour.svg" packingFormat="png" /> <bitmap id="ArmHour" filename="arm_hour.svg" automaticPalette="false" />
<bitmap id="ArmMinute" filename="arm_minute.svg" packingFormat="png" /> <bitmap id="ArmMinute" filename="arm_minute.svg" automaticPalette="false" />
<bitmap id="ArmSecond" filename="arm_second.svg" packingFormat="png" /> <bitmap id="ArmSecond" filename="arm_second.svg" automaticPalette="false" />
<bitmap id="Icons" filename="icons.png" packingFormat="png" automaticPalette="true" /> <bitmap id="Icons" filename="icons.png" automaticPalette="false" />
</drawables> </drawables>

View File

@ -110,17 +110,19 @@ class KittieCatsView extends WatchUi.WatchFace
// --- Complications --- // --- Complications ---
self.drawShadowedText(dc, 116, 186, Graphics.FONT_XTINY, complications.HeartRate, Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER, dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_TRANSPARENT);
Graphics.COLOR_BLACK, Graphics.COLOR_WHITE, 2);
self.drawShadowedText(dc, 195, 313, Graphics.FONT_XTINY, complications.Steps, Graphics.TEXT_JUSTIFY_LEFT | Graphics.TEXT_JUSTIFY_VCENTER, self.drawValue(dc, 116, 186, Graphics.FONT_XTINY, complications.HeartRate, "-",
Graphics.COLOR_BLACK, Graphics.COLOR_WHITE, 2); Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER);
self.drawShadowedText(dc, 195, 346, Graphics.FONT_XTINY, complications.BodyBattery, Graphics.TEXT_JUSTIFY_LEFT | Graphics.TEXT_JUSTIFY_VCENTER, self.drawValue(dc, 195, 313, Graphics.FONT_XTINY, complications.Steps, "-",
Graphics.COLOR_BLACK, Graphics.COLOR_WHITE, 2); Graphics.TEXT_JUSTIFY_LEFT | Graphics.TEXT_JUSTIFY_VCENTER);
self.drawShadowedText(dc, 261, 346, Graphics.FONT_XTINY, complications.Stress, Graphics.TEXT_JUSTIFY_LEFT | Graphics.TEXT_JUSTIFY_VCENTER, self.drawValue(dc, 195, 346, Graphics.FONT_XTINY, complications.BodyBattery, "-",
Graphics.COLOR_BLACK, Graphics.COLOR_WHITE, 2); Graphics.TEXT_JUSTIFY_LEFT | Graphics.TEXT_JUSTIFY_VCENTER);
self.drawValue(dc, 261, 346, Graphics.FONT_XTINY, complications.Stress, "-",
Graphics.TEXT_JUSTIFY_LEFT | Graphics.TEXT_JUSTIFY_VCENTER);
} }
} }
@ -180,16 +182,25 @@ class KittieCatsView extends WatchUi.WatchFace
} }
private function drawShadowedText(dc as Dc, x as Lang.Numeric, y as Lang.Numeric, font as Graphics.FontType, private function drawValue(dc as Dc, x as Lang.Numeric, y as Lang.Numeric, font as Graphics.FontType,
text as Lang.Object or Null, justification as Graphics.TextJustification or Lang.Number, text as Lang.Object or Null, nullText as Lang.Object, justification as Graphics.TextJustification or Lang.Number) as Void
{
dc.drawText(x, y, font, text == null ? nullText : text, justification);
}
/*
private function drawShadowedValue(dc as Dc, x as Lang.Numeric, y as Lang.Numeric, font as Graphics.FontType,
text as Lang.Object or Null, nullText as Lang.Object, justification as Graphics.TextJustification or Lang.Number,
textColor as Graphics.ColorType, shadowColor as Graphics.ColorType, shadowOffset as Lang.Numeric) as Void textColor as Graphics.ColorType, shadowColor as Graphics.ColorType, shadowOffset as Lang.Numeric) as Void
{ {
dc.setColor(shadowColor, Graphics.COLOR_TRANSPARENT); dc.setColor(shadowColor, Graphics.COLOR_TRANSPARENT);
dc.drawText(x + shadowOffset, y + shadowOffset, font, text, justification); dc.drawText(x + shadowOffset, y + shadowOffset, font, text == null ? nullText : text, justification);
dc.setColor(textColor, Graphics.COLOR_TRANSPARENT); dc.setColor(textColor, Graphics.COLOR_TRANSPARENT);
dc.drawText(x, y, font, text, justification); dc.drawText(x, y, font, text == null ? nullText : text, justification);
} }
*/
private function drawIcon(dc as Dc, iconIndex as Lang.Numeric, x as Lang.Numeric, y as Lang.Numeric) private function drawIcon(dc as Dc, iconIndex as Lang.Numeric, x as Lang.Numeric, y as Lang.Numeric)