-
Notifications
You must be signed in to change notification settings - Fork 1.3k
backswipe_edge: swipe from the right edge of the screen to go back #4157
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
Conversation
|
Didn't test but looks good I think. One question re pixel counting in review. |
01a1336 to
4563bc6
Compare
|
Nice idea with the edge, so you don't need to count active swipe and drag handlers like we do in |
Thanks :) I guess it would also be possible to draw a little back arrow with an overlay, but you'd probably not see it below your finger 🙈 |
|
There's already a |
I think the logic and design choices are different enough for it to make sense as a new app :) |
Yeah I was wondering about this - we could offset it into the middle of the screen but we have the problem of redrawing the original UI when the arrow's gone. Or we could draw the arrow using the overlay |
Maybe we can do paint over the back button so it "flashes"? Then we wouldn't have to worry about the rest of the screen. Either way I suggest leaving that for a later version :) |
Yeah that could be cool - I do like the vibrate as feedback too, tried it out and it feels just right |
4563bc6 to
8f9c964
Compare
|
Thanks for the review and feedback :) I think I should've addressed all suggestions up until now; no idea how I managed to forget to fill out the "author" field 🙈 Painting over the back button sounds like a neat idea 👍 Accounting for touchscreen calibration seems to work with Bangle.setOptions({touchX1: 0, touchY1: 0, touchX2: 160, touchY2: 160});
Bangle.setOptions({touchX1: 10, touchY1: 0, touchX2: 180, touchY2: 160});
Bangle.setOptions({touchX1: 0, touchY1: 0, touchX2: 140, touchY2: 160});which should ideally sort of somewhat cover real world touchscreen calibrations. |
b859ce8 to
ae24786
Compare
|
Would you mind if we changed the id to |
|
Changes look great to me, thanks for the nice app idea btw! And good thinking both of you with the touchscreen calibration |
Not really set on the name, so can do 👍 But would the name really make much of a difference if everything is copied to On the topic of shorter names being faster: I changed Maybe for hooking up the back button, the
So we could do: Bangle.on("backswipe", (type) => {
switch (type) {
case 1:
// make back button flash / change color
break;
case 2: // fallthrough
case 3:
// return back button back to normal
break;
}
}); |
ae24786 to
4f0e04f
Compare
4f0e04f to
bac313a
Compare
|
I think it's time to merge :) what do you say? |
Please disregard that last bit; I just assumed that the back button widget was an app and not part of the firmware https://github.com/espruino/Espruino/blob/654b3a3847392741bffd6c5b149a42f82844f692/libs/js/banglejs/Bangle_setUI_Q3.js#L143-L157 Modifying the back button sources to respect this app also seems like a bad idea; we could patch the draw function of Also, the
If there aren't any objections to using the jit I'd like to do that, but the back button flashing thing is probably really best left for the future™ so 👍 |
This allows going back by swiping from the right edge of the screen, Android style.
bac313a to
53bbefb
Compare
|
JITing the This should be ready now :) |
|
On the topic of making the back button "flash": |
|
If jit works that's great! Have you looked through https://www.espruino.com/JIT and https://github.com/espruino/Espruino/blob/master/README_JIT.md ? I usually do "ram" keyword for perfmance but have not learned when to use "jit". I wonder if they would work together as well 🤔 |
bobrippling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JITing the
draghandler seems to work alright; I've just pushed that change.
Nice! Like @thyttan says, jit is buggy in places but if it works well under test then the language features being used are likely fine here
On the topic of making the back button "flash": Behold my unholy patching stuff to make the back button turn green https://github.com/ssievert42/BangleApps/tree/backswipeedge_change_back_button (It actually works 🙈)
That is rather unholy! The pattern a lot of apps use for overwriting is to copy the code and tweak it, which in this case is probably less of a diff than modifying the function code at runtime. But we can discuss in a separate PR :)
|
For flashing the button I had a naive solution in mind just painting at the same position of the widget but not really interacting with it. Patching the widget may be better though? Without working it through it feels like it takes a bit more logic, but shouldn't matter. |
👍 Everything we're doing here should ideally fall under the "works" category.
I know, right? It's probably only a matter of time before that breaks, so copying and then modifying the code sounds like a better idea (for a future PR). |
|
So we go ahead? 🙂 |
|
Yes, please 👍 Also, thanks again for the review, feedback and stuff :) |
|
Thanks 😁 |
Sounds good - you may find And thanks for the PR! |
This allows going back by swiping from the right edge of the screen, Android style.
I hacked this together to prevent my button from dying (again).
Not sure if this needs some sort of calibration / settings, but loading a config file at boot seemed like it would slow down load times a bit.
Has been working fine as far as I can tell :)