11-07-2017 06:08
11-07-2017 06:08
I have a watchface with two views. The primary view shows the Date, Time, and limited stats. The secondary has a detailed progress report. I would like the watch to always "wake up" to the clock view. I was looking at the Display API and see the onChange property and addEventListener() method; but was not sure how to implement it.
Are there any examples using event listeners?
Thanks in advance!
Answered! Go to the Best Answer.
11-07-2017 06:40
11-07-2017 06:40
Like this:
import { display } from "display";
display.onchange = function() { if (display.on) { // Screen is on } else { // Screen is off } }
11-07-2017 06:40
11-07-2017 06:40
Like this:
import { display } from "display";
display.onchange = function() { if (display.on) { // Screen is on } else { // Screen is off } }
11-09-2017 06:31
11-09-2017 06:31
That worked like a charm! Thanks