Skip to content

Commit

Permalink
Going back from the code view with button
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Monaco authored and glemco committed Aug 24, 2023
1 parent dafede6 commit 12720c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/cards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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.

Double tapping on the code will come back to the visualization of the card's details.
To come back to the visualization of the card's details from the code view, simply press the button.

Beware that the small screen of the Banglejs 2 cannot render properly complex barcodes (in fact the resolution is very limited to render most barcodes).

Expand Down
7 changes: 2 additions & 5 deletions apps/cards/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,9 @@ function printLinearCode(binary) {
}

function showCode(card) {
var listener = (data) => {
if(data.double) showCard(card);
Bangle.removeListener("tap", listener);
};
Bangle.on("tap", listener);
E.showScroller();
// keeping it on rising edge would come back twice..
setWatch(()=>showCard(card), BTN, {edge:"falling"});
// theme independent
g.setColor(WHITE).fillRect(0, 0, g.getWidth(), g.getHeight());
switch (card.type) {
Expand Down

0 comments on commit 12720c5

Please sign in to comment.