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.
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.
Like this:
import { display } from "display";
display.onchange = function() {
if (display.on) {
// Screen is on
} else {
// Screen is off
}
}
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.