Skip to content

Commit

Permalink
Merge pull request #3630 from bobrippling/feat/settings-menu-return
Browse files Browse the repository at this point in the history
settings: restore previous menu's scroll position
  • Loading branch information
bobrippling authored Nov 20, 2024
2 parents 58a6fee + 308956b commit f1505b2
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 91 deletions.
3 changes: 2 additions & 1 deletion apps/setting/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ of 'Select Clock'
0.71: Minor code improvements
0.72: Add setting for configuring BLE privacy
0.73: Fix `const` bug / work with fastload
0.74: Add extra layer of checks before allowing a factory reset (fix #3476)
0.74: Add extra layer of checks before allowing a factory reset (fix #3476)
0.75: Restore previous menu's scroll positions
10 changes: 10 additions & 0 deletions apps/setting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,13 @@ The exact effects depend on the app. In general the watch will not wake up by i
* **Reset Settings** Reset the settings (as set in this app) to defaults. Does not reset settings for other apps.
* **Factory Reset** (not available on Bangle.js 1) - wipe **everything** and return to a factory state
* **Turn Off** Turn Bangle.js off

# Development

The settings code uses `push/pop/restoreMenu` to navigate different levels of menus. These functions are used as follows:

- `pushMenu`: enter a new level of menu, one deeper than the current (e.g. a submenu)
- `popMenu`: return to the previous menu level, one more shallow than the current (e.g. returning from a submenu)
- `restoreMenu`: redraw the current menu (e.g. after an alert)

These functions will keep track of outer menu's scroll positions, to avoid the user being returned to the very first entry as they navigate.
2 changes: 1 addition & 1 deletion apps/setting/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "setting",
"name": "Settings",
"version": "0.74",
"version": "0.75",
"description": "A menu for setting up Bangle.js",
"icon": "settings.png",
"tags": "tool,system",
Expand Down
Loading

0 comments on commit f1505b2

Please sign in to comment.