diff --git a/Meditate/source/activity/MeditateDelegate.mc b/Meditate/source/activity/MeditateDelegate.mc index 0d9840c..70766d3 100644 --- a/Meditate/source/activity/MeditateDelegate.mc +++ b/Meditate/source/activity/MeditateDelegate.mc @@ -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); + } + } } \ No newline at end of file