Skip to content
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

Add loyalty cards app #2977

Merged
merged 9 commits into from Sep 13, 2023
Merged

Add loyalty cards app #2977

merged 9 commits into from Sep 13, 2023

Conversation

glemco
Copy link
Contributor

@glemco glemco commented Aug 18, 2023

Simple app to display loyalty cards synced from Catima through GadgetBridge.
The app can display the cards' info (balance, expiration, note, etc.) and tapping on the appropriate field will display the code, if the type is supported.

This is pretty much a proof of concept, many codes may be too complex to be rendered by the bangle's screen or hardware (at least with the current logic).

Simple synchronization support is added in https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3268 .
We send all cards in one go after pressing the button in GB, just like it is implemented on ZeppOS. We may think of some way (like hard limiting the number of cards) to avoid loading too many and crash the device. Right now it's responsibility of the user not to overload the watch. Any synchronization is overwriting the file.

Any help or comment is highly appreciated.

@glemco glemco force-pushed the cards branch 4 times, most recently from 2029dd3 to 15f9693 Compare August 22, 2023 04:59
@joserebelo
Copy link
Contributor

This is cool :)

Not sure if expected (still new to the Bangle), but I am unable to go back after opening a QR code - I must hold the button to go back to the watchface. Is this expected?

@glemco
Copy link
Contributor Author

glemco commented Aug 22, 2023

Thanks for trying it out!
Basically that's something I misunderstood with the definition of the touch and the tap events.
A double tap (the one used to go back from the code view) doesn't involve the screen at all, you need to tap on the device, let's say on the frame.
I'd probably replace it with a long touch on the screen (double touch isn't just as trivial), but for now I wanted to see how it looked like.

@joserebelo
Copy link
Contributor

Oh wow - it's possible to double-tap the actual device 🤯

Couldn't we make single-tap on the button go back?

@glemco
Copy link
Contributor Author

glemco commented Aug 22, 2023

Yeah that's another idea, I could try it out 👍

@glemco glemco marked this pull request as ready for review September 8, 2023 04:45
@glemco glemco force-pushed the cards branch 2 times, most recently from e67a034 to 12720c5 Compare September 8, 2023 05:00
@bobrippling
Copy link
Collaborator

Cool idea - I'll let Gordon merge this as it's modified the android app, but thought I'd ask, would you say it's ready to go?
I just spotted this in android/boot.js:

console.log("Wrong cards event structure " + event); //TODO remove this

@glemco
Copy link
Contributor Author

glemco commented Sep 12, 2023

Thanks @bobrippling for spotting this! Fixed and I'd say it's quite ready to go (of course considering the limitations I mentioned in the README)

@bobrippling
Copy link
Collaborator

Thanks! One more thing I've just thought - is the C qrcode under any particular license?

@glemco
Copy link
Contributor Author

glemco commented Sep 13, 2023

Both QR and barcode libs are under MIT, I linked them in the README. Should I add the licenses to this repo too?

@@ -236,6 +236,11 @@
event.t="remove";
}
require("messages").pushMessage(event);
},
"cards" : function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please could you just add a comment here saying this is for the 'cards' app?

@gfwilliams
Copy link
Member

Wrt licenses, please could you add a comment at the top of each of the JS files (just what they're based on and what the license is) - I think that'd be ok for us with it in the README as well.

It looks good to me (although I guess in an ideal world the android app would just emit a GB event and this app would tag onto that with a boot.js file) - but that's not something that is done at the moment

@glemco
Copy link
Contributor Author

glemco commented Sep 13, 2023

@gfwilliams thanks for the answer, I updated the files.

Yeah I was thinking it wasn't a good way to add yet another handler there but just went with the flow..

@gfwilliams
Copy link
Member

Great - thanks!

@gfwilliams gfwilliams merged commit 03e9d0f into espruino:master Sep 13, 2023
1 check passed
@glemco glemco deleted the cards branch September 14, 2023 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants