Announcement

Collapse
No announcement yet.

Menu options on Connectiq 1.4

Collapse
X
  • Time
  • Show
Clear All
new posts

  • Menu options on Connectiq 1.4

    I have a FR630 and i'd like to use the default menu's in an connectiq app i am coding, like the menu's which are in the FR firmware itself. The nice thing in the normal menu is that apart from the menu item text, there are also icons and values. e.g.:
    - when you press menu on the normal clock. You will see the word clock, but also an icon of a clock.
    - When you hit that menu item, you will see the text "watchface", but also a subline at that menu item stating the current selected menu item.

    If i look at the API, i only see something like:

    function onMenu() {
    var menu = new WatchUi.Menu();
    var delegate;
    menu.setTitle("My Menu");
    menu.addItem("Item One", ne);
    menu.addItem("Item Two", :two);
    delegate = new MyMenuDelegate(); // a WatchUi.MenuInputDelegate
    WatchUi.pushView(menu, delegate, WatchUi.SLIDE_IMMEDIATE);
    return true;
    }


    This menu.additem only allows for an item text, not an icon and also not a subvalue.

    Does anyone know how I can add this to a custom coded menu?


    KR ARnold
    (PS i know the menu2 has more functionalities, but this a FR630. So this class is not available)

  • #2
    I posted about this a while back. Hope this helps.

    (If you want to see it in a "real" app:
    https://apps.garmin.com/en-US/apps/3...8-f45584b0a117
    )

    It looks a little funny in the simulator (with the animation), but I tried it on a real 935 and I think it looks normal IRL. I also haven't heard any complaints (yet) about the menu from users. Although you can obviously try it out for yourself on a real device.

    https://forums.garmin.com/forum/deve...code-available
    I've forked and updated the Dynamic Menu CIQ class by Dave Baldwin:
    https://github.com/flowstatedev/Dmenu

    Dynamic Menu is a class that extends the CIQ1/2 Menu class with the following functionality (similar to CIQ3 Menu2):
    - Menu items support sublabels
    - Insert/update/delete items on the fly
    - Add items other than text (e.g. icons) by overriding draw() in an item subclass.

    What I added (not much):
    - Fix intermittent crash
    - Add proper touchscreen scrolling support
    -- Swipe up/down to scroll

    (The original DMenu would force you to swipe left/right on certain old touchscreen devices, which is not intuitive for a vertically-oriented menu)
    -- Tap above/below center item to scroll, just like native menus in old touchscreen watches like Vivoactive and FR630.
    This is especially important for Vivoactive, because VA does not even support up/down swipes.

    I really liked this class because it allowed me to provide a similar settings menu UX for CIQ1/2 devices and CIQ3 devices, in the same app. (Although I did use Menu2 for the CIQ3 devices.)

    I hope others will find this useful in some way. If something better exists, I'd like to hear about it, too.
    Last edited by FlowState; 01-09-2019, 12:33 PM.

    Comment


    • #3
      Nice! I tried the app. The menu lay-out is not correct on my fr630, but the code is there so i think i have enough info to implement correctie in my app...

      Thank you!

      Comment


      • #4
        akamming You're welcome!

        The menu lay-out is not correct on my fr630,
        Really? :/

        What's wrong with the layout? It looks okay in the simulator and on a real 935. I don't have a real 630 to test with, and like I said, I'm sure the problem with the animation is only in the simulator.... To be clear, if you run the menu in the simulator, it will look funny (misaligned after animation), but it should look okay in real life.

        AFAIK, that code should work with all watches, regardless of screen shape, size or touchscreen/buttons.

        EDIT: If you change ANIM_TIME to 0, it should look perfect in the simulator, too, for 630. Although that causes other problems, both in the simulator and in real life.
        Last edited by FlowState; 01-09-2019, 03:41 PM.

        Comment


        • #5
          I'd like to hear if Dynamic Menu looks weird for anyone else on a real watch (especially 230, 235, 630, 735 or 920 owners).

          Thanks!

          Comment


          • #6
            Originally posted by FlowState View Post
            I'd like to hear if Dynamic Menu looks weird for anyone else on a real watch (especially 230, 235, 630, 735 or 920 owners).

            Thanks!
            This is what it looks like on my real FR630 (not the simulator)

            DynamicMenu.jpg

            To replicate:
            - install and start the stop and go app
            - Press menu (a correct screen appears with a correct layout)
            - Swipe up or down (this layout appears)
            - Siping back results in the same wrong layout



            Comment


            • #7
              akamming thanks! I'm pretty sure this has to do with the scrolling animations which:
              - look wrong in the simulator no matter which device
              - look okay on a real 935
              - apparently look wrong on a real 630

              I will try to resolve by either disabling animations or figuring out what's wrong with them in the code. I know that 230/630/etc had firmware issues with animations at one point, so it may be impossible to fix without disabling animations.

              EDIT: I'm pretty sure there's something wrong with the code....
              Last edited by FlowState; 01-11-2019, 09:49 AM.

              Comment


              • #8
                akamming I have fixed the DMenu code on github and updated the two stopwatch apps. If you don't mind, it would be awesome if you could test one of them for me and let me know if it works.

                Thanks for the bug report!

                BTW, the lesson here is:
                - You shouldn't have believed me when I said the visual problem was only in the simulator :P. (Pretty sure you didn't anyway....)
                - I shouldn't have believed the original author when he said the visual problem was only in the simulator >_>

                Comment


                • #9
                  Sure. Can you eens me the links of the app code on github ?

                  Comment


                  • #10
                    akamming the Stop and Go app code is not available on github, although DMenu is.
                    https://github.com/flowstatedev/Dmenu

                    The Stop and Go app has been updated on the app store with the latest DMenu. If you still have it installed, you can just update using Garmin Connect. Or you can download it again:
                    https://apps.garmin.com/en-US/apps/3...8-f45584b0a117

                    Or you could just build the example app in the DMenu project and run it on your watch. It's the exact same code either way.

                    Anyway, if you don't have time to test, I understand. I'm pretty sure it will work now, anyway, unless there's still something wrong with animations on 230/630/etc.

                    If you are interested in a "settings menu" class that implements what you see in the Stop and Go app, I was thinking of taking that code and adapting for general use, but I wasn't sure if anybody had any interest. To be clear, it would be something where you would just add top-level "settings" with option values, and the code would automatically generate the submenus for you, as well as updating the parent menu sublabel and app settings (properties) when a value is changed in a submenu. Obviously, right now you would have to do all of that manually or write your own class to do it in a nice way.

                    Let me know. I held off on doing it because it would also be a bit of rewrite to clean it up for general use, so I wouldn't do it unless there's interest.
                    Last edited by FlowState; 01-11-2019, 11:56 AM.

                    Comment


                    • #11
                      Clear, so i redownloaded your app. It is already better, but not yet ok

                      See attached photo for the result. I now see moving menu's, they just do not always to the right place yet.. if i swipe up or down the text always goes a bit too high or too low.. so still something wrong in the alignment.

                      aboiut the dmenu code: I don't see any changes in the dmenu repository. Are you sure you pushed to code back to the repository?

                      KR Arnold

                      Comment


                      • #12
                        akamming yep, the last commit is 2 hours ago in my fork, not the original repo:
                        https://github.com/flowstatedev/Dmenu

                        Thanks for testing that. I don't see an attached photo in your post tho.

                        I wonder if I should've just removed animation in the first place. It would be nice to get it working tho.

                        Comment


                        • #13
                          Originally posted by FlowState View Post
                          akamming yep, the last commit is 2 hours ago in my fork, not the original repo:
                          https://github.com/flowstatedev/Dmenu

                          Thanks for testing that. I don't see an attached photo in your post tho.

                          I wonder if I should've just removed animation in the first place. It would be nice to get it working tho.
                          Ok. I looked at the original repo.

                          I really see a photo in m previous post. Maybe refresh the browser

                          i already have a working menu (my widget is called garmoticz. It's in the connectiq store. Look it up if you want to know what i am developing) I am looking for the animation. I hope you can fix it....

                          Comment


                          • #14
                            akamming to avoid wasting everyone's time, I have just modded DMenu so that animation is disabled completely. You can re-enable it by modding or subclassing the code so that ANIM_TIME > 0. Unfortuately I can't work on it because I don't have a 630 (any longer). You are welcome to try to get it working on the real 630 if you like. One clue I can give you is to log the value of drawMenu.t in the simulator, in the drawMenu.draw() function. That was how I realized what was wrong in the first place. The original code assumed that the animation would always run all the way to the end, but it doesn't on some devices and the sim.

                            I updated the github repo (again) and the apps in the store have been updated too.

                            Thanks again. Let me know if there are any other problems. I want this class to be usable and to look good.
                            Last edited by FlowState; 01-11-2019, 12:35 PM.

                            Comment


                            • #15
                              akamming I see a photo in post #6 but no other post. The forum dun goofed again, I think.

                              BTW, I think all the other forks and the original repo for the project are dead. It really says a lot about the state of CIQ development that something as basic and useful as this was not touched in two years, and had multiple issues (like crashing).... I wonder if everyone is just re-inventing the wheel over and over again in their own apps.
                              Last edited by FlowState; 01-11-2019, 12:33 PM.

                              Comment

                              Working...
                              X