diff --git a/HrvAlgorithms/sources/activity/FitSessionSpec.mc b/HrvAlgorithms/sources/activity/FitSessionSpec.mc index 1610530..b50d250 100644 --- a/HrvAlgorithms/sources/activity/FitSessionSpec.mc +++ b/HrvAlgorithms/sources/activity/FitSessionSpec.mc @@ -20,5 +20,13 @@ module HrvAlgorithms { :sport => SPORT_MEDITATION }; } + + static function createBreathing(sessionName) { + return { + :name => sessionName, + :sport => ActivityRecording.SPORT_TRAINING, + :subSport => SUB_SPORT_BREATHWORKS + }; + } } } \ No newline at end of file diff --git a/Meditate/manifest.xml b/Meditate/manifest.xml index 2fdc108..8a7e182 100644 --- a/Meditate/manifest.xml +++ b/Meditate/manifest.xml @@ -1,7 +1,7 @@ - + diff --git a/Meditate/resources-por/strings/strings.xml b/Meditate/resources-por/strings/strings.xml index 2878c8a..fd5d8d4 100644 --- a/Meditate/resources-por/strings/strings.xml +++ b/Meditate/resources-por/strings/strings.xml @@ -41,10 +41,12 @@ Atividade Yoga Meditação + Respiração Atividade Yoga Meditação + Respiração Monit. VFC Detalhado (Padrão) @@ -148,7 +150,7 @@ VFC Pronto VFC Deslig. - Meditate 6.1.0 + Meditate 6.2.0 vtrifonov dliedke diff --git a/Meditate/resources/menus/globalSettings/newActivityTypeOptionsMenu.xml b/Meditate/resources/menus/globalSettings/newActivityTypeOptionsMenu.xml index 0c121ce..905ee6b 100644 --- a/Meditate/resources/menus/globalSettings/newActivityTypeOptionsMenu.xml +++ b/Meditate/resources/menus/globalSettings/newActivityTypeOptionsMenu.xml @@ -1,4 +1,5 @@ + \ No newline at end of file diff --git a/Meditate/resources/menus/session/activityTypeMenu.xml b/Meditate/resources/menus/session/activityTypeMenu.xml index 55c6c2a..2c7d653 100644 --- a/Meditate/resources/menus/session/activityTypeMenu.xml +++ b/Meditate/resources/menus/session/activityTypeMenu.xml @@ -1,4 +1,5 @@ + \ No newline at end of file diff --git a/Meditate/resources/strings/strings.xml b/Meditate/resources/strings/strings.xml index 457141d..21b8956 100644 --- a/Meditate/resources/strings/strings.xml +++ b/Meditate/resources/strings/strings.xml @@ -41,10 +41,12 @@ Activity Yoga Meditating + Breathing Activity Type Yoga Meditating + Breathing Hrv Tracking On Detailed (Default) @@ -147,7 +149,7 @@ HRV Ready HRV off - Meditate 6.1.0 + Meditate 6.2.0 vtrifonov dliedke diff --git a/Meditate/source/activity/MeditateActivity.mc b/Meditate/source/activity/MeditateActivity.mc index 0456e1f..91dcede 100644 --- a/Meditate/source/activity/MeditateActivity.mc +++ b/Meditate/source/activity/MeditateActivity.mc @@ -20,9 +20,13 @@ class MediteActivity extends HrvAlgorithms.HrvAndStressActivity { if (meditateModel.getActivityType() == ActivityType.Yoga) { fitSessionSpec = HrvAlgorithms.FitSessionSpec.createYoga(createSessionName(sessionTime, activityNameProperty)); // Due to bug in Connect IQ API for breath activity to get respiration rate, we will use Yoga as default meditate activity } - else { + if (meditateModel.getActivityType() == ActivityType.Meditating) { fitSessionSpec = HrvAlgorithms.FitSessionSpec.createMeditation(createSessionName(sessionTime, activityNameProperty)); } + if (meditateModel.getActivityType() == ActivityType.Breathing) { + fitSessionSpec = HrvAlgorithms.FitSessionSpec.createBreathing(createSessionName(sessionTime, activityNameProperty)); + } + me.mMeditateModel = meditateModel; HrvAlgorithms.HrvAndStressActivity.initialize(fitSessionSpec, meditateModel.getHrvTracking(), heartbeatIntervalsSensor); } diff --git a/Meditate/source/globalSettings/GlobalSettingsDelegate.mc b/Meditate/source/globalSettings/GlobalSettingsDelegate.mc index 4f413e7..76f776e 100644 --- a/Meditate/source/globalSettings/GlobalSettingsDelegate.mc +++ b/Meditate/source/globalSettings/GlobalSettingsDelegate.mc @@ -119,25 +119,12 @@ class GlobalSettingsDelegate extends ScreenPicker.ScreenPickerDelegate { } details.detailLines[3].value.text = multiSessionSetting; - // Activity type settings (not enough screen space for everything) - /* - details.detailLines[4].icon = new ScreenPicker.Icon({ - :font => StatusIconFonts.fontMeditateIcons, - :symbol => StatusIconFonts.Rez.Strings.meditateFontYoga - }); - var newActivityType = GlobalSettings.loadActivityType(); - if (newActivityType == ActivityType.Meditating) { - details.detailLines[4].value.text = Ui.loadResource(Rez.Strings.menuNewActivityTypeOptions_meditating); - } - if (newActivityType == ActivityType.Yoga) { - details.detailLines[4].value.text = Ui.loadResource(Rez.Strings.menuNewActivityTypeOptions_yoga); - } - */ + // Preparation time settings details.detailLines[4].icon = new ScreenPicker.Icon({ - :font => StatusIconFonts.fontMeditateIcons, - :symbol => StatusIconFonts.Rez.Strings.meditateFontYoga + :font => StatusIconFonts.fontAwesomeFreeRegular, + :symbol => StatusIconFonts.Rez.Strings.faClock }); // Calculate minutes and seconds from the loaded prepare time @@ -149,7 +136,25 @@ class GlobalSettingsDelegate extends ScreenPicker.ScreenPickerDelegate { details.detailLines[4].value.text = Ui.loadResource(Rez.Strings.menuPrepareTimeOptions_title) + ": " + minutes + ":" + (seconds < 10 ? "0" : "") + seconds; - // Show Respiration rate settings if supported + // New Activity type settings + details.detailLines[5].icon = new ScreenPicker.Icon({ + :font => StatusIconFonts.fontMeditateIcons, + :symbol => StatusIconFonts.Rez.Strings.meditateFontYoga, + :color => Gfx.COLOR_GREEN + }); + var newActivityType = GlobalSettings.loadActivityType(); + if (newActivityType == ActivityType.Meditating) { + details.detailLines[5].value.text = Ui.loadResource(Rez.Strings.menuNewActivityTypeOptions_meditating); + } + if (newActivityType == ActivityType.Yoga) { + details.detailLines[5].value.text = Ui.loadResource(Rez.Strings.menuNewActivityTypeOptions_yoga); + } + if (newActivityType == ActivityType.Breathing) { + details.detailLines[5].value.text = Ui.loadResource(Rez.Strings.menuNewActivityTypeOptions_breathing); + } + + // Show Respiration rate settings if supported (not enough screen space for everything) + /* if (HrvAlgorithms.RrActivity.isRespirationRateSupported()) { var respirationRateSetting = ""; @@ -163,6 +168,7 @@ class GlobalSettingsDelegate extends ScreenPicker.ScreenPickerDelegate { } details.detailLines[5].value.text = Ui.loadResource(Rez.Strings.menuGlobalSettings_respiration) + respirationRateSetting; } + */ details.setAllLinesYOffset(me.mGlobalSettingsLinesYOffset); details.setAllIconsXPos(me.mGlobalSettingsIconsXPos); diff --git a/Meditate/source/globalSettings/GlobalSettingsMenuDelegate.mc b/Meditate/source/globalSettings/GlobalSettingsMenuDelegate.mc index 2e0da87..bed4098 100644 --- a/Meditate/source/globalSettings/GlobalSettingsMenuDelegate.mc +++ b/Meditate/source/globalSettings/GlobalSettingsMenuDelegate.mc @@ -147,6 +147,9 @@ class GlobalSettingsMenuDelegate extends Ui.MenuInputDelegate { else if (item == :yoga) { GlobalSettings.saveActivityType(ActivityType.Yoga); } + else if (item == :breathing) { + GlobalSettings.saveActivityType(ActivityType.Breathing); + } mOnGlobalSettingsChanged.invoke(); } diff --git a/Meditate/source/sessionSettings/AddEditSessionMenuDelegate.mc b/Meditate/source/sessionSettings/AddEditSessionMenuDelegate.mc index 32467fc..111b30d 100644 --- a/Meditate/source/sessionSettings/AddEditSessionMenuDelegate.mc +++ b/Meditate/source/sessionSettings/AddEditSessionMenuDelegate.mc @@ -83,7 +83,10 @@ class AddEditSessionMenuDelegate extends Ui.MenuInputDelegate { } else if (item == :yoga) { sessionModel.activityType = ActivityType.Yoga; - } + } + else if (item == :breathing) { + sessionModel.activityType = ActivityType.Breathing; + } me.mOnChangeSession.invoke(sessionModel); } diff --git a/Meditate/source/sessionSettings/SessionModel.mc b/Meditate/source/sessionSettings/SessionModel.mc index 2f7e5e5..ba06e36 100644 --- a/Meditate/source/sessionSettings/SessionModel.mc +++ b/Meditate/source/sessionSettings/SessionModel.mc @@ -23,7 +23,8 @@ module VibePattern { module ActivityType { enum { Meditating = 0, - Yoga = 1 + Yoga = 1, + Breathing = 2 } }