Skip to content

Commit

Permalink
bugfix - load settings
Browse files Browse the repository at this point in the history
  • Loading branch information
okdar committed Jan 24, 2024
1 parent 665cdc1 commit 492f134
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.0.1 (January 24, 2024)
* bugfix - loading settings

# 2.0.0 (January 19, 2024)
* improved screen resolution scaling
* new watch models supported - Approach® S70, D2™ Mach 1, Descent™ MK3, epix™, epix™ Pro, fēnix® 7, fēnix® 7 Pro, fēnix® 7S, fēnix® 7S Pro, fēnix® 7X, fēnix® 7X Pro, Forerunner® 255, Forerunner® 255S, Forerunner® 265, Forerunner® 265S, Forerunner® 55, Forerunner® 955, Forerunner® 965, MARQ® (Gen 2), MARQ™ Aviator (Gen 2), Venu® Sq. Music Edition, quatix® 6, quatix® 6X, tactix® 7
Expand Down
2 changes: 1 addition & 1 deletion manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. -->
<iq:manifest xmlns:iq="http://www.garmin.com/xml/connectiq" version="3">
<iq:application entry="SmartArcsTripApp" id="547fb49c0626476280e1121801561e5c" launcherIcon="@Drawables.LauncherIcon" minSdkVersion="3.0.0" name="@Strings.AppName" type="watchface" version="2.0.0">
<iq:application entry="SmartArcsTripApp" id="547fb49c0626476280e1121801561e5c" launcherIcon="@Drawables.LauncherIcon" minSdkVersion="3.0.0" name="@Strings.AppName" type="watchface" version="2.0.1">
<iq:products>
<iq:product id="approachs62"/>
<iq:product id="approachs7042mm"/>
Expand Down
2 changes: 1 addition & 1 deletion manifest.xml.beta
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. -->
<iq:manifest xmlns:iq="http://www.garmin.com/xml/connectiq" version="3">
<iq:application entry="SmartArcsTripApp" id="5b7bdde686cc4867be63faf4c6ca83fb" launcherIcon="@Drawables.LauncherIcon" minSdkVersion="3.0.0" name="@Strings.AppName" type="watchface" version="2.0.35">
<iq:application entry="SmartArcsTripApp" id="5b7bdde686cc4867be63faf4c6ca83fb" launcherIcon="@Drawables.LauncherIcon" minSdkVersion="3.0.0" name="@Strings.AppName" type="watchface" version="2.0.36">
<iq:products>
<iq:product id="approachs62"/>
<iq:product id="approachs7042mm"/>
Expand Down
2 changes: 1 addition & 1 deletion manifest.xml.prod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. -->
<iq:manifest xmlns:iq="http://www.garmin.com/xml/connectiq" version="3">
<iq:application entry="SmartArcsTripApp" id="547fb49c0626476280e1121801561e5c" launcherIcon="@Drawables.LauncherIcon" minSdkVersion="3.0.0" name="@Strings.AppName" type="watchface" version="2.0.0">
<iq:application entry="SmartArcsTripApp" id="547fb49c0626476280e1121801561e5c" launcherIcon="@Drawables.LauncherIcon" minSdkVersion="3.0.0" name="@Strings.AppName" type="watchface" version="2.0.1">
<iq:products>
<iq:product id="approachs62"/>
<iq:product id="approachs7042mm"/>
Expand Down
30 changes: 15 additions & 15 deletions source/SmartArcsTripView.mc
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,17 @@ class SmartArcsTripView extends WatchUi.WatchFace {
hasTemperatureHistory = Toybox.SensorHistory has :getTemperatureHistory;
}

screenWidth = dc.getWidth();
screenRadius = screenWidth / 2;
//TINY font for screen resolution 240 and lower, SMALL for higher resolution
if (screenRadius <= 120) {
font = Graphics.FONT_TINY;
} else {
font = Graphics.FONT_SMALL;
}
hrTextDimension = dc.getTextDimensions("888", font); //to compute correct clip boundaries

loadUserSettings();
computeConstants(dc);
computeSunConstants();
fullScreenRefresh = true;
}

Expand Down Expand Up @@ -458,21 +466,14 @@ class SmartArcsTripView extends WatchUi.WatchFace {
locationLongitude = app.getProperty("locationLongitude");

//ensure that screen will be refreshed when settings are changed
powerSaverDrawn = false;
powerSaverDrawn = false;

computeConstants();
computeSunConstants();
}

//pre-compute values which don't need to be computed on each update
function computeConstants(dc) {
screenWidth = dc.getWidth();
screenRadius = screenWidth / 2;

//TINY font for screen resolution 240 and lower, SMALL for higher resolution
if (screenRadius <= 120) {
font = Graphics.FONT_TINY;
} else {
font = Graphics.FONT_SMALL;
}

function computeConstants() {
//computes hand lenght for watches with different screen resolution than 260x260
screenResolutionRatio = screenRadius / 130.0; //130.0 = half of vivoactive4 resolution; used for coordinates recalculation
hourHandLength = recalculateCoordinate(60);
Expand All @@ -491,7 +492,6 @@ class SmartArcsTripView extends WatchUi.WatchFace {
computeTicks();
}

hrTextDimension = dc.getTextDimensions("888", font); //to compute correct clip boundaries
halfHRTextWidth = hrTextDimension[0] / 2;

getNumberOfSamples(upperGraph);
Expand Down

0 comments on commit 492f134

Please sign in to comment.