diff --git a/README.md b/README.md index f86c77d..f36450d 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,8 @@ Code and ideas borrowed from [RunnersField by kpaumann](https://github.com/kopa/ ## Changelog +- 1.6.1 + - Fix a bug introduced by changes in 1.6.0 - 1.6.0 - Add support for new devices, update translations - 1.5.1 diff --git a/source-memoryGTE32K/WalkerView.mc b/source-memoryGTE32K/WalkerView.mc index 6b72fdf..0cf37da 100644 --- a/source-memoryGTE32K/WalkerView.mc +++ b/source-memoryGTE32K/WalkerView.mc @@ -87,8 +87,10 @@ class WalkerView extends Ui.DataField { // If the activity has restarted after "resume later", load previously stored steps values if (info != null && info.elapsedTime > 0) { - steps = Application.Properties.getValue("as"); - activityStepsAtPreviousLap = Application.Properties.getValue("ls"); + var app = Application.getApp(); + steps = app.getProperty("as"); + activityStepsAtPreviousLap = app.getProperty("ls"); + app = null; if (steps == null) { steps = 0; } if (lapSteps == null) { lapSteps = 0; } // Consolidate the previously stored steps, otherwise we will lose them when steps are next calculated @@ -110,30 +112,31 @@ class WalkerView extends Ui.DataField { function readSettings() { var deviceSettings = System.getDeviceSettings(); + var app = Application.getApp(); // 12 / 24 hour mode is24Hour = deviceSettings.is24Hour; // Dark mode - darkModeFromSetting = Application.Properties.getValue("d") == true; + darkModeFromSetting = app.getProperty("d") == true; // Speed / pace mode - paceOrSpeedMode = Application.Properties.getValue("pm"); + paceOrSpeedMode = app.getProperty("pm"); if (paceOrSpeedMode > 0) { paceOrSpeedData = new DataQueue(paceOrSpeedMode, true); } else { paceOrSpeedData = null; } - heartRateMode = Application.Properties.getValue("hm"); + heartRateMode = app.getProperty("hm"); if (heartRateMode > 0) { heartRateData = new DataQueue(heartRateMode, true); } else { heartRateData = null; } - showHeartRateZone = Application.Properties.getValue("z"); - showSpeedInsteadOfPace = Application.Properties.getValue("s"); + showHeartRateZone = app.getProperty("z"); + showSpeedInsteadOfPace = app.getProperty("s"); kmOrMileInMetersDistance = deviceSettings.distanceUnits == System.UNIT_METRIC ? 1000.0f : 1609.34f; kmOrMileInKmPace = deviceSettings.paceUnits == System.UNIT_METRIC ? 1.0f : 1.60934f; diff --git a/source/WalkerApp.mc b/source/WalkerApp.mc index e8d7691..967d1c1 100644 --- a/source/WalkerApp.mc +++ b/source/WalkerApp.mc @@ -11,8 +11,9 @@ class WalkerApp extends App.AppBase { function onStop(state) { // Store current step counts for later usage (e.g., resume later) - Application.Properties.setValue("as", mainView.steps); - Application.Properties.setValue("ls", mainView.activityStepsAtPreviousLap); + var app = Application.getApp(); + app.setProperty("as", mainView.steps); + app.setProperty("ls", mainView.activityStepsAtPreviousLap); } function onSettingsChanged() {