Watchface behaviour on returning from app list

Hi everyone,

I'm writing a watchface that uses background temporal events to pull data from a couple of APIs and then present the key elements graphically.  Everything is working pretty well except one minor irritation that I just cannot figure out.

When I install the watchface on my actual watch (Fenix 6s) something strange is happening when I return to the watch face from the app list (ie from watchface click top right button -> list of apps displayed -> click bottom right button to return to watchfact -> watchface reappears).  When the watchface reappears everything is redrawn exactly as before (so all good so far), but there is a semitransparent white/light grey overlay across the whole screen which only goes when the screen does a full refresh at the next minute ticks over. 

What is more frustrating is that I can't seem to recreate it in the simulator so a bit stuck on how to diagnose.

I would be really grateful for any advice (eg I assume 'onUpdate()' is called when returning to the watchface, but is there anything else)?

 Happy coding!

  • When onUpdate is called, you always want to redraw the entire screen.  It sounds like you may only be doing part of the screen.

  • Watchface is inherited from View, you may want to override onShow function to redraw entire screen too.

  • there is no dc in onShow

  • Thanks eveyrone for the replies.

    jim_m_58 you are right, I have tried to avoid redrawing the whole screen everytime onUpdate is called to conserve battery power given that the display does some complex stuff (well for me at least!) and the screen graphics should only change once per minute (ie on tick over of the minute) or if a number of user settings are changed. 

    Shinatesu, the way I have tried to deal with the 'exceptional' times to redraw the whole screen is to set flags in onShow() and onExitSleep() which I then query at the start of the onUpdate() logic.  The psuedo code is basically

    function onShow()

     - set redraw_falgs

    function onExitSleep()

     - set redraw_flags

    function onUpdate()

     - if (new_minute OR user_settings_changed OR redraw_flags set) execute screen draw logic

    So it looks to me that I haven't found the right method that is triggered on exitting the app list and returning to the watch face. 

    I hope that makes sense and thanks for any further advice.


    Regards

    PT

  • Hi everyone,

    One thing I have noticed is that when I return to the watchface from the list of widgets the watchface is displayed fine, it's only when returning to the watchface from the list of apps that I have the issue.....so does anyone know what the difference is in the way that the two different scenarios are handled?

    Thanks

    PT

  • It also varies by device.  There are a number of threads about this, and it's why you need to do a full update in onUpdate.  The only time you can get away with only doing part of a watch face on all devices is with onPartialUpdate.