diff --git a/apps/dtlaunch/ChangeLog b/apps/dtlaunch/ChangeLog index 1054aa387..ea9ca729f 100644 --- a/apps/dtlaunch/ChangeLog +++ b/apps/dtlaunch/ChangeLog @@ -16,3 +16,6 @@ 0.16: Use default Bangle formatter for booleans 0.17: Bangle 2: Fast loading on exit to clock face. Added option for exit to clock face by timeout. +0.18: Move interactions inside setUI. Replace "one click exit" with +back-functionality through setUI, adding the red back button as well. Hardware +button to exit is no longer an option. diff --git a/apps/dtlaunch/app-b2.js b/apps/dtlaunch/app-b2.js index 48d9b2f38..df5bfc48f 100644 --- a/apps/dtlaunch/app-b2.js +++ b/apps/dtlaunch/app-b2.js @@ -8,15 +8,10 @@ let settings = Object.assign({ showClocks: true, showLaunchers: true, direct: false, - oneClickExit: false, swipeExit: false, timeOut: "Off" }, require('Storage').readJSON("dtlaunch.json", true) || {}); -if (settings.oneClickExit) { - var buttonWatch = setWatch(_=> returnToClock(), BTN1, {edge: 'falling'}); -} - let s = require("Storage"); var apps = s.list(/\.info$/).map(app=>{ let a=s.readJSON(app,1); @@ -91,7 +86,7 @@ let drawPage = function(p){ Bangle.loadWidgets(); //g.clear(); -Bangle.drawWidgets(); +//Bangle.drawWidgets(); drawPage(0); let swipeListenerDt = function(dirLeftRight, dirUpDown){ @@ -106,7 +101,6 @@ let swipeListenerDt = function(dirLeftRight, dirUpDown){ drawPage(page); } }; -Bangle.on("swipe",swipeListenerDt); let isTouched = function(p,n){ if (n<0 || n>3) return false; @@ -138,25 +132,18 @@ let touchListenerDt = function(_,p){ selected=-1; } }; -Bangle.on("touch",touchListenerDt); const returnToClock = function() { Bangle.setUI(); - if (buttonWatch) { - clearWatch(buttonWatch); - delete buttonWatch; - } - if (timeoutToClock) { - clearTimeout(timeoutToClock); - delete timeoutToClock; - } - Bangle.removeListener("swipe", swipeListenerDt); - Bangle.removeListener("touch", touchListenerDt); - var apps = []; - delete apps; - delete returnToClock; setTimeout(eval, 0, s.read(".bootcde")); }; + +Bangle.setUI({ + mode : 'custom', + back : returnToClock, + swipe : swipeListenerDt, + touch : touchListenerDt +}); // taken from Icon Launcher with minor alterations var timeoutToClock; diff --git a/apps/dtlaunch/metadata.json b/apps/dtlaunch/metadata.json index b71f4ca9b..2892b758e 100644 --- a/apps/dtlaunch/metadata.json +++ b/apps/dtlaunch/metadata.json @@ -1,7 +1,7 @@ { "id": "dtlaunch", "name": "Desktop Launcher", - "version": "0.17", + "version": "0.18", "description": "Desktop style App Launcher with six (four for Bangle 2) apps per page - fast access if you have lots of apps installed.", "screenshots": [{"url":"shot1.png"},{"url":"shot2.png"},{"url":"shot3.png"}], "icon": "icon.png", diff --git a/apps/dtlaunch/settings-b2.js b/apps/dtlaunch/settings-b2.js index 80ad0414a..24959df8c 100644 --- a/apps/dtlaunch/settings-b2.js +++ b/apps/dtlaunch/settings-b2.js @@ -5,7 +5,6 @@ showClocks: true, showLaunchers: true, direct: false, - oneClickExit:false, swipeExit: false, timeOut: "Off" }, require('Storage').readJSON(FILE, true) || {}); @@ -47,13 +46,6 @@ writeSettings(); } }, - /*LANG*/'One click exit': { - value: settings.oneClickExit, - onchange: v => { - settings.oneClickExit = v; - writeSettings(); - } - }, /*LANG*/'Time Out': { // Adapted from Icon Launcher value: timeOutChoices.indexOf(settings.timeOut), min: 0, @@ -63,6 +55,6 @@ settings.timeOut = timeOutChoices[v]; writeSettings(); } - }, + } }); });