From 81ba4e17fa06b5319c0d4f0768c67eb1a2c3f561 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Wed, 19 Oct 2022 21:04:46 +0200 Subject: [PATCH] gpstrek - Change from leftright UI to custom with swipe --- apps/gpstrek/app.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/apps/gpstrek/app.js b/apps/gpstrek/app.js index 0c3579d4b..4db9a945d 100644 --- a/apps/gpstrek/app.js +++ b/apps/gpstrek/app.js @@ -318,16 +318,22 @@ function triangle (x, y, width, height){ ]; } +function onSwipe(dir){ + if (dir < 0) { + nextScreen(); + } else if (dir > 0) { + switchMenu(); + } else { + nextScreen(); + } +} + function setButtons(){ - Bangle.setUI("leftright", (dir)=>{ - if (dir < 0) { - nextScreen(); - } else if (dir > 0) { - switchMenu(); - } else { - nextScreen(); - } - }); + let options = { + mode: "custom", + swipe: onSwipe + }; + Bangle.setUI(options); } function getApproxFileSize(name){