-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Slider] New library for input via sliders #2953
Conversation
Thanks - do you think maybe the slider library should just be in |
I was wondering about that actually. Does it make sense to develop it like this and change it to that when it's ready for merge? |
Up to you really - whatever you find easier. If you're developing with just the IDE you can have two files open now, one of which is the module and one of which is the app, and that should work nicely. |
0f17a68
to
2cddc29
Compare
eee024e
to
8ca3772
Compare
ba1d6f8
to
680dd9a
Compare
c9b4f24
to
3e33fcd
Compare
@gfwilliams would it make sense to make this compatible with Bangle.js 1? Or is the ram constraint too narrow so it isn't worth it to implement it? |
The Bangle.js 1 doesn't provide any x/y touch input (it's just two areas) and there are no overlays so I don't think this makes sense. Come to think of it, I see you using overlays here - is that really needed? Putting up an overlay is a lot slower than just updating the screen, so if there's a way of doing this without overlays it seems that'd be better. |
Thanks!
Ok, I was thinking of maybe using the LR-swipes on bangle 1.
Ok! I opted for overlays to not mess with the other graphics of the current app. So that when the slider times out and goes away the graphics behind is still there. But maybe that can be achieved without overlays also? Or otherwise, maybe it's better to expect the app to draw again when the slider timed out? |
Thanks! I'm just a bit anxious that right now we assume that apps aren't using overlays - for instance if I might be better to assume the app will redraw. I recently added:
Which is in cutting edge builds (and will be released in 2v19) which showMenu/showPrompt/showScroller all implement - so if you're planning on using the slider from Although it's probably not a big deal to just ask the caller to redraw in the callback, and it might be safer |
527125e
to
3c1f36b
Compare
One solution here would be to:
But I currently don't know how to achieve step 1. Edit: I can probably refactor to do like the top answer here: https://stackoverflow.com/questions/25199343/javascript-calling-a-inner-function-from-outside. Don't know if it's the best route. |
6a08d31
to
e196972
Compare
... which would cause glitches.
as per: espruino#2953 (comment) To still be able to draw on top of the slider, in the callback wrap the extra drawing inside a `setTimeout(extraDraw,0)` or similar. Thanks @bobrippling!
as per: espruino#2953 (comment) To still be able to draw on top of the slider, in the callback wrap the extra drawing inside a `setTimeout(extraDraw,0)` or similar. Thanks @bobrippling!
b23a37c
to
4d6edb1
Compare
6486922
to
4d7bcce
Compare
Looks like you're still doing a bunch of work on this, so maybe I'll hold off merging until things calm down a bit? |
8530dd0
to
8bd1cbb
Compare
@gfwilliams, I think this is OK to merge, and would be happy to have it be so. The remaining checkboxes can be handled in another PR I think. But also, I would be interested in what you think about the naming of things before the initial introduction to the main repo. If you see anything apparent regarding that it could be good to take it into account before merging. |
Thanks! I had a look and as far as I'm concerned, that naming all looks pretty good. Layout does use |
Ok! Thanks for the help on this @gfwilliams and @bobrippling 😊 |
My pleasure, glad to see this slider work finished! Thank you too! |
WIP
Companion PR to Gadgetbridge.
This is meant to become a flexible and as lightweight/performant implementation of ui with input sliders as I can manage.
https://thyttan.github.io/BangleApps/apps/slidertest/screenshot-1.png
To try it out:
vg
command (vg = Volume Get level).vg
command.Still much to do:
drag
event?Android Integration
versions - make sure nothing breaks at least. SEEMS TO NOT BREAK.Layout
module? E.g. adapt to usingthis
?"ram"
in functions? (Test app will use blocks of memory ca 3230 with vs 2930 without "ram", out of 12000 blocks. With "ram" a slider using map feels snappier, but it's not a super big difference.)other considerations:
After I remove my drag handlers there will be an entrySee: [Slider] New library for input via sliders #2953 (comment) and [Slider] New library for input via sliders #2953 (comment).undefined
in the first position of drag handlers. Should this entry be completely removed instead? (yes I think) how?