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
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
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
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
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
Best Answer