How well does Menu2 work?

I'm thinking about a new home automation app where the Menu2 component could be very useful.

I would likely need three types of menu items:

  • A menu item that opens another menu, for building hierarchical menus - probably just a plain MenuItem.

  • A menu item representing an on/off switch - likely using ToggleMenuItem.

  • A menu item that displays some information and opens a view to manipulate that data. For example, showing a thermostat's current temperature and allowing adjustments - this would probably require a CustomMenuItem.

On paper, it looks like everything I need is already available. However, before diving in, I want to check: do all of these elements actually work reliably?
In the past, I've run into issues where SDK features seemed fine in the simulator but failed in real-world use. So I figured I'd better ask first.

  • Another feature I need is the ability to update items dynamically. I would be polling data in the background, and if the state of a switch changes, I would need to update the corresponding ToggleMenuItem. Is that possible? Would using ToggleMenuItem.setEnabled() together with Menu2.updateItem() work for this? Or is calling setEnabled() alone enough to update the screen?

  • I tried it - using ToggleMenuItem.setEnabled() along with WatchUi.requestUpdate() does the trick.

  • So far everything I tried works well. One thing I am not that happy with is that the ToggleMenuItem breaks the label much earlier than needed given the available space. Maybe to leave room for an icon, which does not exist in my case.

  • Check how it looks on the real watch.  Some of the native (non ciq) views in the sim can be  kind of generic. And with native views, they are done by the platform groups and not CIQ.

  • I do change the menu dynamically, but it's changing when the user chooses some menu item. It might be a bit harder to update the screen from a background process. Though maybe it can even do the web request's from the foreground app

  • At least in the simulator it works well. The web requests are executed by the widget app, the callbacks update the menu items, and then WatchUi.requestUpdate updates the screen. Right now I just chain the requests, once processing of one is complete, the next is started. This leads to close to real-time feel, switching on a light flips the corresponding switch right away. Not sure though how well it will work on a real device. 

  • Are you using icons with your menu items?

    From what I can tell, it doesn’t seem possible to combine an icon (via IconMenuItem) with something like a ToggleMenuItem, correct? The ToggleMenuItem options include an :icon parameter, but it doesn’t seem to have any effect - and the documentation mentions it's only supported on Instinct 2.

    So if I want both a toggle and an icon, it looks like I'd need to implement a custom CustomMenuItem and handle all the drawing manually. Is that right?

  • Yes, either icon, or toggle

  • Thanks!

    From what I can tell, it seems that CustomMenuItem can only be used with a CustomMenu.

    Is that correct?

    I tried adding a CustomMenuItem to a Menu2. It compiles without errors, but when I call WatchUi.pushView with the Menu2, the push fails and returns false. There's no exception thrown, so it’s hard to tell exactly what’s going wrong - but the same code works fine if I don't add the CustomMenuItem to the Menu2.

  • I’m currently testing CustomMenu. So far, it works well overall. However, it seems that the :titleItemHeight option has no effect. While :footerItemHeight correctly adjusts the height of the footer, the title height remains unchanged, no matter what value I assign to :titleItemHeight.