11-07-2017 06:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-07-2017 06:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
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.
Accepted Solutions
11-07-2017 06:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


11-07-2017 06:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Like this:
import { display } from "display";
display.onchange = function() { if (display.on) { // Screen is on } else { // Screen is off } }
11-07-2017 06:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


11-07-2017 06:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Like this:
import { display } from "display";
display.onchange = function() { if (display.on) { // Screen is on } else { // Screen is off } }
11-09-2017 06:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-09-2017 06:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
That worked like a charm! Thanks

