Changing layout or view in a watchface with partial updates

Former Member
Former Member
Hi

I have a watchface with two very similar but different layouts that I am trying to change between based on user settings.

What I am trying to do is quite similar to this thread: https://forums.garmin.com/forum/developers/connect-iq/118576-

However on a Vivoactive 3 with partial updates I get one of two scenarios:

1) I try and change the layout or instantiate a new instance of the view I am in - and the watchface immediately crashes.

2) I change the layout or instantiate a new instance of the view in the App class in onSettingsChanged() - this doesn't crash the watchface, but the watchface doesn't change the screen until I take another action such as swipe to a widget and then swipe back. I think this is because during onSettingsChanged() may happen during a partial update. In the View this is worked around by setting a flag that settings are changed and updating the settings on the next OnUpdate, but this isn't possible at the App level.

Has anyone experienced this or got a suggested workaround?

Many thanks

Keith
  • There are a few things here are sound a bit odd, and maybe I don't understand what you're typing to do.

    How does onPartialUpdate() come into play here? (the title suggests partial updates) And you're trying to create a new view from onSettingsChanged? There's only one view for watchfaces.

    In onSettingsChanged, why not just do a UI.requestUpdate() which calls onUpdate in the view and do things there like switching the layout?

    What do you see in \garmin\apps\logs\ciq_log? Are you sideloading a non-release build? Do that, as the ciq_log could help. What happens in the sim?
  • Hi Keith,

    My watchface NoFrills can change between layouts based on a user setting.
    It works perfectly on all devices, even those with onPattialUpdate.

    I believe it is just a matter of getting the order of loading and setting variables right.

    You can send me a minimalistic version of your code so I can take a look.
  • Also, there recently was a bug fix for the va3 to fix the onSettingsChanged not being called.
    You may want to check if you have the latest firmware on the va3.
  • Former Member
    Former Member over 6 years ago
    Many thanks - I have managed to get this working now using SetLayout to change the layout in the view.