mirror of https://github.com/espruino/BangleApps
commit
0b9e511173
|
@ -8,3 +8,7 @@
|
|||
Add swipe-to-exit
|
||||
0.08: Only use fast loading for switching to clock to prevent problems in full screen apps
|
||||
0.09: Remove fast load option since clocks containing Bangle.loadWidgets are now always normally loaded
|
||||
0.10: changed the launch.json file name in iconlaunch.json ( launch.cache.json -> iconlaunch.cache.json)
|
||||
used Object.assing for the settings
|
||||
fix cache not deleted when "showClocks" options is changed
|
||||
added timeOut to return to the clock
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
{
|
||||
const s = require("Storage");
|
||||
const settings = s.readJSON("launch.json", true) || { showClocks: true, fullscreen: false,direct:false,swipeExit:false,oneClickExit:false};
|
||||
const settings = Object.assign({
|
||||
showClocks: true,
|
||||
fullscreen: false,
|
||||
direct: false,
|
||||
oneClickExit: false,
|
||||
swipeExit: false,
|
||||
timeOut:"Off"
|
||||
}, s.readJSON("iconlaunch.json", true) || {});
|
||||
|
||||
console.log(settings);
|
||||
if (!settings.fullscreen) {
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
let launchCache = s.readJSON("launch.cache.json", true)||{};
|
||||
let launchHash = require("Storage").hash(/\.info/);
|
||||
let launchCache = s.readJSON("iconlaunch.cache.json", true)||{};
|
||||
let launchHash = s.hash(/\.info/);
|
||||
if (launchCache.hash!=launchHash) {
|
||||
launchCache = {
|
||||
hash : launchHash,
|
||||
|
@ -20,7 +29,7 @@
|
|||
if (a.name>b.name) return 1;
|
||||
return 0;
|
||||
}) };
|
||||
s.writeJSON("launch.cache.json", launchCache);
|
||||
s.writeJSON("iconlaunch.cache.json", launchCache);
|
||||
}
|
||||
let scroll = 0;
|
||||
let selectedItem = -1;
|
||||
|
@ -198,6 +207,11 @@
|
|||
|
||||
|
||||
if (settings.oneClickExit) mode.btn = returnToClock;
|
||||
if (settings.timeOut!="Off"){
|
||||
let time=parseInt(settings.timeOut); //the "s" will be trimmed by the parseInt
|
||||
setTimeout(returnToClock,time*1000);
|
||||
}
|
||||
|
||||
|
||||
Bangle.setUI(mode);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "iconlaunch",
|
||||
"name": "Icon Launcher",
|
||||
"shortName" : "Icon launcher",
|
||||
"version": "0.09",
|
||||
"version": "0.10",
|
||||
"icon": "app.png",
|
||||
"description": "A launcher inspired by smartphones, with an icon-only scrollable menu.",
|
||||
"tags": "tool,system,launcher",
|
||||
|
@ -12,6 +12,7 @@
|
|||
{ "name": "iconlaunch.app.js", "url": "app.js" },
|
||||
{ "name": "iconlaunch.settings.js", "url": "settings.js" }
|
||||
],
|
||||
"data": [{"name":"iconlaunch.json"},{"name":"iconlaunch.cache.json"}],
|
||||
"screenshots": [{ "url": "screenshot1.png" }, { "url": "screenshot2.png" }],
|
||||
"readme": "README.md"
|
||||
}
|
||||
|
|
|
@ -1,24 +1,29 @@
|
|||
// make sure to enclose the function in parentheses
|
||||
(function(back) {
|
||||
const s = require("Storage");
|
||||
let settings = Object.assign({
|
||||
showClocks: true,
|
||||
fullscreen: false,
|
||||
direct: false,
|
||||
oneClickExit: false,
|
||||
swipeExit: false
|
||||
}, require("Storage").readJSON("launch.json", true) || {});
|
||||
swipeExit: false,
|
||||
timeOut:"Off"
|
||||
}, s.readJSON("iconlaunch.json", true) || {});
|
||||
|
||||
let fonts = g.getFonts();
|
||||
function save(key, value) {
|
||||
settings[key] = value;
|
||||
require("Storage").write("launch.json",settings);
|
||||
s.write("iconlaunch.json",settings);
|
||||
}
|
||||
const timeOutChoices = [/*LANG*/"Off", "10s", "15s", "20s", "30s"];
|
||||
const appMenu = {
|
||||
"": { "title": /*LANG*/"Launcher" },
|
||||
/*LANG*/"< Back": back,
|
||||
/*LANG*/"Show Clocks": {
|
||||
value: settings.showClocks == true,
|
||||
onchange: (m) => { save("showClocks", m) }
|
||||
onchange: (m) => {
|
||||
save("showClocks", m);
|
||||
s.erase("iconlaunch.cache.json"); //delete the cache app list
|
||||
}
|
||||
},
|
||||
/*LANG*/"Fullscreen": {
|
||||
value: settings.fullscreen == true,
|
||||
|
@ -35,7 +40,15 @@
|
|||
/*LANG*/"Swipe exit": {
|
||||
value: settings.swipeExit == true,
|
||||
onchange: m => { save("swipeExit", m) }
|
||||
}
|
||||
},
|
||||
/*LANG*/'Time Out': {
|
||||
value: timeOutChoices.indexOf(settings.timeOut),
|
||||
min: 0, max: timeOutChoices.length-1,
|
||||
format: v => timeOutChoices[v],
|
||||
onchange: m => {
|
||||
save("timeOut", timeOutChoices[m]);
|
||||
}
|
||||
},
|
||||
};
|
||||
E.showMenu(appMenu);
|
||||
});
|
||||
|
|
|
@ -8,4 +8,5 @@
|
|||
0.08: removed unused font, fix autocycle, imported suncalc and trimmed, removed pedometer dependency, "tap to cycle" setting
|
||||
0.09: fix battery icon size
|
||||
0.10: Tell clock widgets to hide.
|
||||
0.11: fix issue https://github.com/espruino/BangleApps/issues/2128 (#2128) ( settings undefined )
|
||||
0.11: fix issue https://github.com/espruino/BangleApps/issues/2128 (#2128) ( settings undefined )
|
||||
0.12: implemented widget_utils
|
|
@ -2,7 +2,7 @@
|
|||
"id": "rebble",
|
||||
"name": "Rebble Clock",
|
||||
"shortName": "Rebble",
|
||||
"version": "0.11",
|
||||
"version": "0.12",
|
||||
"description": "A Pebble style clock, with configurable background, three sidebars including steps, day, date, sunrise, sunset, long live the rebellion",
|
||||
"readme": "README.md",
|
||||
"icon": "rebble.png",
|
||||
|
|
|
@ -309,16 +309,8 @@ else{
|
|||
}
|
||||
|
||||
|
||||
g.clear();
|
||||
Bangle.loadWidgets();
|
||||
/*
|
||||
* we are not drawing the widgets as we are taking over the whole screen
|
||||
* so we will blank out the draw() functions of each widget and change the
|
||||
* area to the top bar doesn't get cleared.
|
||||
*/
|
||||
for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";}
|
||||
|
||||
|
||||
require("widget_utils").hide();
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue