espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.78k stars 746 forks source link

E.showScroller_Q3 - Give coordinates in item to select callback #2291

Closed halemmerich closed 1 year ago

halemmerich commented 1 year ago

Main motivation for this is removing the code duplication from https://github.com/espruino/BangleApps/blob/master/apps/iconlaunch/app.js.

gfwilliams commented 1 year ago

Nice idea - thanks! I guess making iconlaunch backwards compatible could be a pain though

halemmerich commented 1 year ago

I think attempting that with Bangle.js 1 Buttons/Touch would remove any speed improvements versus the default launcher anyway :)

gfwilliams commented 1 year ago

:) Oh no - I just meant ensuring icon launcher worked on older firmwares too

halemmerich commented 1 year ago

Conditionally wrapping the touch handler and select handler, storing the touch event and select parameters and then calling the select handler with those as parameters could be enough. Iconlaunch does only need the x value to decide which of the three elements has been selected. Or just wait until 2v16 is in the field for a few weeks before changing iconlaunch and wait if anybody actually has a problem with this :)