-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal for a more leaner UI #9
Comments
I have to agree, the second line of text has not been adding much value. A good idea at the time... Thank you for your interest. |
Hello! I am already writing on a prototype/spike for this feature and being close to finish it. First time doing something with Monkey C... so my progress is a bit slow ;-) When it is ready to show, I will post the branch. |
We've so far used SVG for icons from here in order to be able to scale them with a Python script to all the sizes required for the different models of watch. We'll then need to modify that script to work with non-square icons in order to maintain the aspect ratio. Look forward to hearing from you. |
Here is the current state of the spike: https://github.com/Someone0nEarth/GarminHomeAssistant/tree/lean_ui Its on "make it work" level. For "make it right" it would need to remove code redundancy, adjust icons positions, tune the resize script and so on. Using Monkey C, especially the connect IQ Api is quite a adventure... for example IconMenuItem layout behaves differently to ToggleMenuItem: For Toggle, the icon can be right of the label and the label is centered. For Icon this is not possible (the label will be right aligned). Maybe a CustomMenuItem would be a solution for a more fitting design. My next step will be to clean up the code à la "make it right", as a small learning session, what are the capabilities of Monkey C. |
I'll have a go at buliding it locally this afternoon, I can see the work you've put in. You may have noted from the Python script, we use the 48x48 SVG icons as the source and amend the sizes from there to make the other folders. Fixing the icon script should be trivial. |
Yep, I used 48x48 as the source ✌️ At the moment, the two new SVGs are white (because the app has a black background on my Venu), but on the emulator (Linux), the background is white, so they are not visible on that (at least for me). I didn`t do adjustment of the icon size, positioning etc. yet. I would like to see the label centered and the icon on the right side (like the layout of the toggle menu item). My current impression is, that using CustomMenuItem for this, is the only way to go. But as already mentioned: First time ever for me coding Garmin stuff :) |
I'm trying to understand:
Starting to think this is going to be troublesome. BTW I'm still very much learning "Monkey C" too. I did a little development a while back on a Garmin controller for a Google Nest, but that understanding has now evapourated! (The app was not release for several complicating reasons.) |
CustomMenuItem inherits from WatchUi.MenuItem, so should work with Menu2 too.
My first guess would be, that Graphics.DC (device context) would be the thing for this.
Yep, my proposal would be, that using IconMenuItem would be good enough for a "MVP". And maybe, someday, when we think, we need a more fancy design, we could considering using CustomMenuItem :) |
Except I was unable to get the
"You should never directly instantiate a Dc object, or attempt to render to the screen outside of an onUpdate call." I think we need a WatchUi.Drawable for this. I've just not figured out how to specify |
Heyhey again! I like the idea with the left alignment! Will test it on my device.
Yes, dealing with the code redundancy was although on my todo-list :) I will change the lean ui to left aligment and do the refactorings ✌️ |
I was wondering if for simplicity the non-lean UI should go left aligned for consistency? It was only ever right aligned as that was the default and I did not change it. No good reason for the choice, other than MVP code. |
I added an app setting for the alignment (which is used for lean and sublabel). Sadly.. ToggleItems labels are still centered, while the IconItems label are left/right aligned. This is especially a little annoying, when the menu has toogle and icon items.. but for a MVP it is fine enough for me. And maybe one day Garmin will align the behavior of both item types. |
When I simulated the venu2 above, it looked likt ToggleItems obeyed the alignment. |
I don`t trust the emulators any longer ;) On my (real) Venu, the Toggle labels are centered while the icon labels are left (right) aligned :/ |
After I removed the code redundancy, I would say the feature would be ready for a pull request. I changed the tap-icon color to blue and the menu-icon color to grey. I am open for other suggestions :) |
Looks like you are right: The API doc says for for example for ToggleMenuItems "A ToggleMenuItem can be added to a Menu2 using the addItem() method." and for CustomMenuItem "A CustomMenuItem can be added to a CustomMenu using the addItem() method.". But yeah.. maybe a topic for the future! |
Hello, I removed the redundant code from the spike and aligned the naming of the menu item types. I would say, the "lean ui" branch is ready for a code review and after that, we could do the pull request. https://github.com/Someone0nEarth/GarminHomeAssistant/tree/lean_ui Have fun, |
I synced the feature branch with main and rebased it. |
Hi, could you create a pull request now because it makes code review easier and you can continue to commit to your branch (and the pull request) once it is created. Thanks |
Hello!
A proposal for a more leaner UI:
Menu icon:
Tap icon:
Thanks for your nice work so far :)
Greetings,
someone
The text was updated successfully, but these errors were encountered: