From 9aca470ed1ba41c67eef727236641f2613bd52ef Mon Sep 17 00:00:00 2001 From: Adam Leadbetter Date: Wed, 22 Jan 2020 16:45:22 +0000 Subject: [PATCH] Publishing 1.3.0 --- .project | 17 ----------------- README.md | 6 ++++++ doc/on-view-only-settings.mdown | 5 +++++ doc/rate-settings.md | 2 ++ manifest.xml | 2 +- resources/properties.xml | 8 ++++++++ resources/strings/strings.xml | 4 ++++ source/TempoTrainerView.mc | 33 +++++++++++++++++++++++++-------- 8 files changed, 51 insertions(+), 26 deletions(-) delete mode 100644 .project create mode 100644 doc/on-view-only-settings.mdown diff --git a/.project b/.project deleted file mode 100644 index 001ebf0..0000000 --- a/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - TempoTrainer - - - - - - connectiq.builder - - - - - - connectiq.projectNature - - diff --git a/README.md b/README.md index 55a5688..3992b3e 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,9 @@ X _ _ _ ## Managing Settings Settings should be managed through Garmin Connect Mobile or Garmin Express. + +### On view only settings +Starting with release 1.2.0, Tempo Trainer has an option to operate in an always on mode (default) or in an on view only mode. See [here](https://github.com/adamml/tempo-trainer/blob/master/doc/on-view-only-settings.md) for more details. + +### Rate Settings +Rate settings are described [here](https://github.com/adamml/tempo-trainer/blob/master/doc/rate-settings.md) \ No newline at end of file diff --git a/doc/on-view-only-settings.mdown b/doc/on-view-only-settings.mdown new file mode 100644 index 0000000..75e8f3a --- /dev/null +++ b/doc/on-view-only-settings.mdown @@ -0,0 +1,5 @@ +#On View Only + +If you choose "yes", then the Tempo Trainer data field will only provide audible and vibration alerts when it is visible on the watch face. + +Choose "no" to have these alerts always happen when the Tempo Trainer data field is enabled for an activity. \ No newline at end of file diff --git a/doc/rate-settings.md b/doc/rate-settings.md index 68f9c9d..80c77b3 100644 --- a/doc/rate-settings.md +++ b/doc/rate-settings.md @@ -1,3 +1,5 @@ +#Rate Settings + The editing of the rate settings is limited by Connect IQ. It is not possible to switch the contextualisation of the rate settings when switching between the two modes of the app (timed intervals and beats per minute). diff --git a/manifest.xml b/manifest.xml index a6c8423..1bc0edf 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,5 +1,5 @@ - + diff --git a/resources/properties.xml b/resources/properties.xml index 1fa4737..45944b1 100644 --- a/resources/properties.xml +++ b/resources/properties.xml @@ -5,6 +5,7 @@ 0 0 1 + 0 @@ -23,6 +24,13 @@ + + + @Strings.onViewOnlyFalse + @Strings.onViewOnlyTrue + + + @Strings.notifyVibrate diff --git a/resources/strings/strings.xml b/resources/strings/strings.xml index 196ba3c..d6e98db 100644 --- a/resources/strings/strings.xml +++ b/resources/strings/strings.xml @@ -12,4 +12,8 @@ Vibrate, Tone + Visual Tone + Visual Visual Only + No + Select "no" to have the data field use vibration and/or tone alerts at all times when the data field is enabled for an activity (default); select "yes" to only have alerts active when the data field is in view on the watch screen. + Use vibration and/or tone alerts only when the data field is visible + Yes diff --git a/source/TempoTrainerView.mc b/source/TempoTrainerView.mc index 725fcbd..27c146a 100644 --- a/source/TempoTrainerView.mc +++ b/source/TempoTrainerView.mc @@ -27,6 +27,9 @@ class TempoTrainerView extends WatchUi.SimpleDataField { hidden var _nextRate; hidden var _timerState = NOT_RUNNING; + + hidden var _isHidden = false; + hidden var _noShowMode; function initialize() { SimpleDataField.initialize(); @@ -39,12 +42,14 @@ class TempoTrainerView extends WatchUi.SimpleDataField { _dataFieldMode = App.Properties.getValue("mode"); _attentionMode = App.Properties.getValue("notify"); _rate = App.Properties.getValue("rate"); + _noShowMode = App.Properties.getValue("onViewOnly"); } else { _dataFieldMode = Application.getApp().getProperty("mode"); _attentionMode = Application.getApp().getProperty("notify"); _rate = Application.getApp().getProperty("rate"); + _noShowMode = Application.getApp().getProperty("onViewOnly"); } } catch (e instanceof Lang.Exception) { @@ -61,15 +66,17 @@ class TempoTrainerView extends WatchUi.SimpleDataField { function compute(info) { if(_timerState == RUNNING){ if(_nextRate <= info.timerTime){ - if (_attentionMode < 3){ - if (_attentionMode > 0){ - if (Attention has :playTone) { - Attention.playTone(_toneProfile[_metronome]); + if (_attentionMode < 3){ + if(!_isHidden){ + if (_attentionMode > 0){ + if (Attention has :playTone) { + Attention.playTone(_toneProfile[_metronome]); + } } - } - if (_attentionMode < 2){ - if(Attention has :vibrate) { - Attention.vibrate(_vibeProfile); + if (_attentionMode < 2){ + if(Attention has :vibrate) { + Attention.vibrate(_vibeProfile); + } } } if(_metronome == 0){ @@ -110,6 +117,16 @@ class TempoTrainerView extends WatchUi.SimpleDataField { _nextRate = 0 + _rate; } + function onHide() { + if(_noShowMode == 1){ + _isHidden = true; + } + } + + function onShow() { + _isHidden = false; + } + function updateSettings() { try{ if(App has :Properties)