Checkbox settings and colour configuration

Hello,

I'm currently working on an app using menus and checkboxes.  The checkbox label and contents are to be stored in the settings, so the user enters what they need in the settings menu.  I am experiencing a few issues, the solutions which I could not find in the Programmer's Guide or in the forums and hoping to get some advice here.

1.  I set a default value for each menu title as a string, but I can't seem to get it to show up in the settings menu; it shows up blank on the device and the settings menu until the user types their custom title in.  Ideally it should display "List 1" as default until the user does their own thing, based on this code below.  What am I missing?

<property id="ListName01" type="string">List 1</property>

<setting propertyKey="@Properties.ListName01" title="@Strings.ListName01Title">
<settingConfig type="alphaNumeric"/>
</setting>

2.  After the user adds their settings, the display does not automatically update unless they go back to the home screen then to the menu list again.  I've added the onSettingsChanged function in the app.mc file with a message log enclosed.  I see the message in the log whenever the settings are changed, but the menu list or checkbox won't change dynamically while looking at them.

function onSettingsChanged() {
WatchUi.requestUpdate();
System.println("Settings changed!");
}

3.  Is it possible to change the colours of the menu list and checkbox from black on white?

Thanks in advance.

  • The first approach definitely works across a wide range of devices, and you can do more than a simple checkbox, like show it in green if it's complete, yellow in progress, or red if it's late.  And when an item is highlighted, select can toggle it's state from in progress to done

  • This kind of thing is easy to implement outside of menus.  In both cases, I have an array of the data, and I initialize the index of that array to 0.

    Then in  onPreviousPage() (for example). I increment the index, wrapping if needed, and call Ui.requestUpdate to call onUpdate, which uses that index and updates the screen. 

    for your case, in onSettingsChanged, just call Ui.requestUpdate, and maybe reset the index to zero.

  • Looking at your list above, does it only have six, or a set amount that can fit on the screen at one time?  I wanted mine to scroll through at least ten items per list, so they can either swipe or use the buttons to navigate through them.  That would make it more complicated to achieve I would think...

  • Just my two cents, but if you want a menu that looks and feels like a native device menu, I would use:

    - DMenu for < CIQ 3. It's not perfect, but it's adequate for the job. I personally put work in to fix bugs and make sure that the touchscreen scrolling behavior works properly for old devices (which are a little quirky and inconsistent with each other -- one device doesn't even support vertical swiping -- you have to swipe left or right to scroll menus, while other devices allow you to either vertically swipe or tap to scroll menus.)

    - Menu2 for CIQ 3

    At least with Menu2 you get a perfectly native look and feel without reinventing the wheel.

    OTOH if you want to have a consistent UX for your app across all devices and/or additional features, then it makes sense for you to implement your own view.

  • For that app, it's only ever got today and the next 5 days, but if I has a list of 10 and wanted to only show 5, that would be a minor change to the logic, and would be in onUpdate()

  • Why use any menu, if it would just make it harder for the user? In my first example, there are 6 items which would be multiple screens with a menu, but I can do it on one and show summary data. On newer devices, something like Menu2 isn't even used for native apps.  There a little part off to the side where you can select save, restore, etc.

  • Yes, I really like Menu2.  The functionality is very close to what I want and works on both touch and non-touch devices, although the look is not exactly consistent across all devices, the update does not happen unless I go to the main page and then back again (still working on the updateItem to see if that can be improved) and I can't change the foreground and background colours.  I looked at the DMenu option for before CIQ 3, but I don't know if I can justify doing all that to support only three additional devices (but I haven't made up my mind yet what to do).

  • You could just use the old CIQ Menu on old devices, and just programmatically pop and recreate it when settings are changed. It won't be a smooth transition but it'll be easier to code.

  • I guess I don't have to use a menu, but I would like a way that the user can interact with lists that they made.  I would like them to be able to maintain 3-5 lists, so the first view could possibly look like the basic menu function (but does not have to be an actual menu).  So the user will see List 1, List 2. List 3 etc listed.

    They can change the names on the settings menu, so it could say something like Todo List, Shopping List etc.  Then they should be able to tap on it and get another view where they can enter at least 10 (or more) items for each of their list in the settings menu and then show up on the device.  So in the beginning it would be blank, but then if the user enters bread, butter, eggs, milk etc then that would show up.  If they want to cross or tap it off and on they should be able to.  Simple really - if only I knew the best way to do that. Grin

  • I could also look into doing that if it is possible.