Announcement

Collapse
No announcement yet.

Repeatable listings in settings.xml

Collapse
X
  • Time
  • Show
Clear All
new posts

  • Repeatable listings in settings.xml

    When developing the options menu, it is necessary for repeated visual elements with a list of values to repeat the full list in each description. If there are several elements of the same type - this turns into a problem - when adding (changing, deleting) values / functions, each list has to be corrected. In addition, each item in the list will be transmitted via Bluetooth to Connect Mobile - with a large number of options, this takes a lot of time.
    I suggest to enter the following structure in settings.xml:

    <defineList id="ColorList">
    <listEntry value="0x000000">@Strings.ColorBlack</listEntry>
    <listEntry value="0x555555">@Strings.ColorDarkGray</listEntry>
    <listEntry value="0xFF0000">@Strings.ColorRed</listEntry>
    <listEntry value="0x00FF00">@Strings.ColorGreen</listEntry>
    <listEntry value="0x00AAFF">@Strings.ColorBlue</listEntry>
    <listEntry value="0xAA0000">@Strings.ColorDarkRed</listEntry>
    <listEntry value="0x00AA00">@Strings.ColorDarkGreen</listEntry>
    <listEntry value="0x0000FF">@Strings.ColorDarkBlue</listEntry>
    <listEntry value="0xFF5500">@Strings.ColorOrange</listEntry>
    <listEntry value="0xAA00FF">@Strings.ColorPurple</listEntry>
    <listEntry value="0xFF00FF">@Strings.ColorPink</listEntry>
    <listEntry value="0xFFFF00">@Strings.ColorYellow</listEntry>
    <listEntry value="0xAAAAAA">@Strings.ColorLightGray</listEntry>
    <listEntry value="0xFFFFFF">@Strings.ColorWhite</listEntry>
    </defineList>

    Defined list as needed can be used repeatedly:

    <setting propertyKey="@Properties.BackgroundColor" title="@Strings.BackgroundColorTitle">
    <settingConfig type="list">
    <definedList id="ColorList">
    </settingConfig>
    </setting>

    <setting propertyKey="@Properties.Label1Color" title="@Strings.Label1ColorTitle">
    <settingConfig type="list">
    <listEntry value="0x000001">@Strings.Hide </listEntry>
    <definedList id="ColorList">
    </settingConfig>
    </setting>
    ....

    In addition, this option will improve the readability of settings.xml

    Watch at the enclosed text of my actual code.
    Attached Files

  • #2
    Having an option to use the same list when setting properties has been brought up many times before, with colors being one that's commonly mentioned. You got the same list of colors, for different properties, and right now the xml involves a bunch of copy/paste. It would be nice to see, but really only helps in the editing of the file

    If that's done, it would have no impact on the device/gcm comm. Here's why that is:.

    When an app is compiled, a .json file is built for settings (you'll see it in the bin directory when you test in the sim). And that's what the App Settings editor in Eclipse uses for settings. Eclipse uses the .json it knows to interact with the .set file the sim knows/

    When you build a .iq for the store, in addition to the different flavors of .prg files, there are also the setting json files. (you can look at a .iq and see the structure - it's really just a .zip file)
    So, these end up in the app store.

    When you do app settings in gcm, gcm pulls the correct json for the device/language from the app store, and the current values from the device. And when the values have been changed, sends them back to the device. But just the values/properties

    This is why you can only do app settings for things in the store and not for sideloads. It needs info in the json from the store. And this is also why you can't do settings without an internet connection.

    A similar thing occurs with fitcontrib data - how to display that in GCM comes from the app store and uses what was in the .iq.
    Last edited by jim_m_58; 12-08-2018, 03:29 PM.
    My Connect IQ Apps in the Store
    Facebook - Instagram -
    Twitter

    Comment


    • #3
      It's something I've also requested in the past. It would indeed increase the maintainability of apps a lot. In my all in one app I have 21 settings with the same repeating list to select which 7 fields to display in 3 activity profiles. What makes matters worse is that these lists are not extensible via inheritance and i need them to differ based on the ciq capabilities available so I need a different set for fenix3 and fenix5 for instance which makes adding/removing an option a maintenance hell.

      Tl;dr I'm in favor of seeing this implemented too
      Last edited by peterdedecker; 12-09-2018, 06:29 AM.
      My best Connect IQ apps:Other:

      Comment


      • #4
        Thank you for reporting this issue. Created a ticket, Weretech-6524, to look into this further.

        Thanks,
        Kamau

        Comment

        Working...
        X