Implemented multiple submenus #138
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added the possibility to have more than one submenu, by replacing MOVEMENT_SECONDARY_FACE_INDEX with an array.
If there is just one submenu, as per default, the behavior is identical to the prior implementation.
If you add more than one submenu, you can reach them by by holding the mode button in the first face.
If you add 0 as the last submenu index, it switches back to the main menu after the last submenu is reached.
I use ~21 faces in my personal build, and spliting them into 4 menus which are easy to reach enhances the availability a lot. Also snapping back to the main menu after the last submenu feels smooth.
Also, this implementation fixes a bug in the prior implementation: when you had no submenu defined (by having MOVEMENT_SECONDARY_FACE_INDEX set to 0), if you long pressed the mode button in the first face, you heard a beep- as the program tried to switch back to the first face (which was alredy displayed). This happened due to an incorrect if-statement in movement.c line 263 (the if-statement should actually be two statements).
Tested on simulator and real hardware (sensorwatch pro with classic display).