Skip to content

Commit

Permalink
Fix issues with tap to turn on/off backlight during activity
Browse files Browse the repository at this point in the history
  • Loading branch information
dliedke committed Aug 8, 2022
1 parent 1510615 commit b77a20a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Meditate/source/activity/MeditateDelegate.mc
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,23 @@ class MeditateDelegate extends Ui.BehaviorDelegate {
}
return false;
}

var backlightOn = false;

function onTap(clickEvent) {
try {

// Touch screen to disable/enable backlight during activity
// This will still respect the backligh timeout configured in the device
backlightOn = !backlightOn;
Attention.backlight(backlightOn);

} catch(ex) {

// Just in case we get a BacklightOnTooLongException for OLED display devices,
// disable backlight
backlightOn = false;
Attention.backlight(backlightOn);
}
}
}

0 comments on commit b77a20a

Please sign in to comment.