From 1c27bb45d3c5c952f9560fba4d611c7e58235db8 Mon Sep 17 00:00:00 2001 From: Gabriele Monaco Date: Thu, 24 Aug 2023 18:27:22 +0200 Subject: [PATCH] Going back from the code view with button --- apps/cards/README.md | 2 +- apps/cards/app.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/cards/README.md b/apps/cards/README.md index 4bd70a0b1..bd9157d62 100644 --- a/apps/cards/README.md +++ b/apps/cards/README.md @@ -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). diff --git a/apps/cards/app.js b/apps/cards/app.js index 691baf987..dcef7da76 100644 --- a/apps/cards/app.js +++ b/apps/cards/app.js @@ -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) {