Skip to content

Commit

Permalink
3.3.0 - Added sound and longer vibration in the end of meditation per…
Browse files Browse the repository at this point in the history
… user request. Added 45min and 1 hour meditation options.
  • Loading branch information
dliedke committed Dec 14, 2023
1 parent f60f2a3 commit c91d165
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Meditate/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="MeditateApp" id="57843a03841b4410aff4e4c427c43caf" launcherIcon="@Drawables.launcherIcon" minSdkVersion="1.4.0" name="@Strings.AppName" type="watch-app" version="3.2.0">
<iq:application entry="MeditateApp" id="57843a03841b4410aff4e4c427c43caf" launcherIcon="@Drawables.launcherIcon" minSdkVersion="1.4.0" name="@Strings.AppName" type="watch-app" version="3.3.0">
<iq:products>
<iq:product id="fr235"/>
</iq:products>
Expand Down
12 changes: 10 additions & 2 deletions Meditate/source/activity/VibeAlertsExecutor.mc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class VibeAlertsExecutor {

// Vibrate long continuous
Attention.vibrate(getLongContinuous());


// Play sound in the end
playFinalTone();

me.mIsFinalAlertPending = false;
}
}
Expand All @@ -41,10 +44,15 @@ class VibeAlertsExecutor {

private static function getLongContinuous() {
return [
new Attention.VibeProfile(100, 3000)
new Attention.VibeProfile(100, 4500)
];
}

private static function playFinalTone() {

Attention.playTone (Attention.TONE_START);
}

private static function getBlip() {
return [
new Attention.VibeProfile(100, 50)
Expand Down
14 changes: 11 additions & 3 deletions Meditate/source/sessionSettings/SessionModel.mc
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,18 @@ class SessionModel {
me.activityType = "Meditate";
}

// 15s for testing
// 45min
if (index == 6) {
me.time = 15;
me.color = Gfx.COLOR_GREEN;
me.time = 45 * 60;
me.color = Gfx.COLOR_BLUE;
me.vibePattern = VibePattern.LongContinuous;
me.activityType = "Meditate";
}

// 60min
if (index == 7) {
me.time = 60 * 60;
me.color = Gfx.COLOR_BLUE;
me.vibePattern = VibePattern.LongContinuous;
me.activityType = "Meditate";
}
Expand Down
4 changes: 2 additions & 2 deletions Meditate/source/storage/SessionStorage.mc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Toybox.Graphics as Gfx;
class SessionStorage {
function initialize() {
mSelectedSessionIndex = 0;
me.mSessionsCount = 7;
me.mSessionsCount = 8;
me.loadSelectedSession();
}

Expand Down Expand Up @@ -32,7 +32,7 @@ class SessionStorage {
}

function getSessionsCount() {
return 7;
return 8;
}

function getSelectedSessionIndex() {
Expand Down

0 comments on commit c91d165

Please sign in to comment.