Problem with colors in watchFace

Hello,

I have a watchface where the user can change the color of the different parts: hours, minutes, date and battery level.
Today I have changed the programming to expand the number of colors. In the simulator everything has gone well but in the clock I have been changing the colors and from a moment when I chose some colors the element did not appear on the screen. If I change to one of the initial colors it reappears.
This is the program:

if (HourcolorNum == 0) {
    dc.setColor(Gfx.COLOR_WHITE, Gfx.COLOR_BLACK); 
} else if (HourcolorNum == 1) {
    dc.setColor(Gfx.COLOR_YELLOW, Gfx.COLOR_BLACK); 
} else if (HourcolorNum == 2) {
    dc.setColor(Gfx.COLOR_RED, Gfx.COLOR_BLACK); 
} else if (HourcolorNum == 3) {
    dc.setColor(Gfx.COLOR_GREEN, Gfx.COLOR_BLACK); 
} else if (HourcolorNum == 4) {
    dc.setColor(Gfx.COLOR_BLUE, Gfx.COLOR_BLACK); 
} else if (HourcolorNum == 5) {
    dc.setColor(Gfx.COLOR_LT_GRAY, Gfx.COLOR_BLACK); 
} else if (HourcolorNum == 6) {
    dc.setColor(Gfx.COLOR_ORANGE, Gfx.COLOR_BLACK); 
} else if (HourcolorNum == 7) {
    dc.setColor(Gfx.COLOR_DK_BLUE, Gfx.COLOR_BLACK); 
} else if (HourcolorNum == 8) {
    dc.setColor(0x5500AA, Gfx.COLOR_BLACK); 
} else if (HourcolorNum == 9) {
    dc.setColor(Gfx.COLOR_PINK, Gfx.COLOR_BLACK); 
}

My device is Vivoactive 3.


Initially they were the first 5 colors.
Does anyone know what could have happened?
Thanks
 

  • You are getting HourcolorNum from either AppBase.getProperty() or Application.Properties.getValue(), right?

    What happens if HourcolorNum is not one of the 10 values you've outlined? What if the type is not Number like you're expecting. There has been a known issue with Garmin Connect Mobile where values come back to the app as values the wrong type or even null. You might need to coerce the value (as described in the New Developer FAQ) or add a default block.

    As for your actual problem, I'm wondering if you've got a published app in the app store that has the 5 values and you're testing a side-loaded version that has 10 values?

  • Yes, var HourcolorNum = Application.getApp().getProperty("HourColor");

    HourcolorNum can only be one of these values ​​because they are the ones configured in settings.xml. Additionally, in properties.xml I say what the default value is.

    My problem is I´ve got a published app in the app store that has the 5 values and when I´ve updated this app with 10 values then I´ve had the problem.

    Thanks for your answer

  • You also want to look at the FAQ and readKeyInt().  EVERY app with settings since CIQ 1.2 I've used a wrapper like is seen there.

    As far as in general, there now seems to be a delay after you do an update to the store ans whn that version is available.   It says 2 hours when you update.

  • For further context, this sounds like a bug which has been reported here:

    https://forums.garmin.com/developer/connect-iq/f/discussion/256748/anybody-else-experiencing-some-weird-out-of-sync-settings-with-app-after-pushing-an-update-to-apps-or-faces

    I noticed that after pushing an update, users which are using Garmin's connect iq app to update will end up with the previous version of the app but with the new settings.  This will create a bunch of not working issues.

    Seems that the only way to get the proper version with settings during that period is to download from the web but use Garmin's connect app to sync to install it.  But then opening Connect iq app will revert to the previous app version and keep the new settings again.

    ...

    I recently desided to update the settings inside on of my watchfaces as well and faced the same issues - people were able to download the new watchface and the watchface tried to work with the old settings...