Skip to content

Commit f99995c

Browse files
gfwilliamsthyttan
authored andcommitted
Enable fast loading on apps that appear to support it - effectively whitelisting apps that can unload quickly - see espruino#4099
1 parent 2574eeb commit f99995c

File tree

18 files changed

+33
-28
lines changed

18 files changed

+33
-28
lines changed

apps/calendar/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
0.18: Minor code improvements
2222
0.19: Read events synchronized from Gadgetbridge
2323
0.20: Correct start time of all-day events synchronized from Gadgetbridge
24+
0.21: Enable fast load with Bangle.load

apps/calendar/calendar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ const showMenu = function() {
286286
E.showMenu();
287287
setUI();
288288
},
289-
/*LANG*/"Exit": () => load(),
289+
/*LANG*/"Exit": () => Bangle.load(),
290290
/*LANG*/"Settings": () =>
291291
eval(require('Storage').read('calendar.settings.js'))(() => {
292292
loadSettings();
@@ -296,7 +296,7 @@ const showMenu = function() {
296296
};
297297
if (require("Storage").read("alarm.app.js")) {
298298
menu[/*LANG*/"Launch Alarms"] = () => {
299-
load("alarm.app.js");
299+
Bangle.load("alarm.app.js");
300300
};
301301
}
302302
require("widget_utils").show();

apps/calendar/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "calendar",
33
"name": "Calendar",
4-
"version": "0.20",
4+
"version": "0.21",
55
"description": "Monthly calendar, displays holidays uploaded from the web interface and scheduled events.",
66
"icon": "calendar.png",
77
"screenshots": [{"url":"screenshot_calendar.png"}],

apps/grocery/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
0.03: Sort selected items to bottom and enable Widgets
44
0.04: Add settings to edit list on device
55
0.05: Drop app customiser as it is redundant with download interface
6+
0.06: Enable fast load with Bangle.load

apps/grocery/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ mainMenu[''] = {
4141
remove: () => {
4242
},
4343
};
44-
mainMenu['< Back'] = ()=>{load();};
44+
mainMenu['< Back'] = ()=>{Bangle.load();};
4545

4646
Bangle.loadWidgets();
4747
menu = E.showMenu(mainMenu);

apps/grocery/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "grocery",
33
"name": "Grocery",
4-
"version": "0.05",
4+
"version": "0.06",
55
"description": "Simple grocery (shopping) list - Display a list of product and track if you already put them in your cart.",
66
"icon": "grocery.png",
77
"type": "app",

apps/podadrem/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ when fastloading.
1111
0.09: Don't send the gadgetbridge wake command twice. Once should do since we issue newline before GB commands.
1212
0.10: Minor code improvements
1313
0.11: Fix a warning from the linter.
14+
0.12: Enable fast load with Bangle.load

apps/podadrem/app.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Bluetooth.println(JSON.stringify({t:"intent", action:"", flags:["flag1", "flag2",...], categories:["category1","category2",...], mimetype:"", data:"", package:"", class:"", target:"", extra:{someKey:"someValueOrString"}}));
44
55
Podcast Addict is developed by Xavier Guillemane and can be downloaded on Google Play Store: https://play.google.com/store/apps/details?id=com.bambuna.podcastaddict&hl=en_US&gl=US
6-
6+
77
How to use intents to control Podcast Addict: https://podcastaddict.com/faq/130
88
*/
99

@@ -20,7 +20,7 @@ let gfx = function() {
2020
// g.drawString(str, x, y, solid)
2121
g.clearRect(R);
2222
g.reset();
23-
23+
2424
if (dark) {g.setColor(0xFD20);} else {g.setColor(0xF800);} // Orange on dark theme, RED on light theme.
2525
g.setFont("4x6:2");
2626
g.setFontAlign(1, 0, 0);
@@ -56,7 +56,7 @@ let touchHandler = function(_, xy) {
5656
let x = xy.x;
5757
let y = xy.y;
5858
let len = (R.w<R.h+1)?(R.w/3):(R.h/3);
59-
59+
6060
// doing a<b+1 seemed faster than a<=b, also using a>b-1 instead of a>=b.
6161
if ((R.x-1<x && x<R.x+len) && (R.y-1<y && y<R.y+len)) {
6262
//Menu
@@ -65,20 +65,20 @@ let touchHandler = function(_, xy) {
6565
backToMenu = true;
6666
E.showMenu(paMenu);
6767
} else if ((R.x-1<x && x<R.x+len) && (R.y2-len<y && y<R.y2+1)) {
68-
//Wake
68+
//Wake
6969
gadgetbridgeWake();
7070
} else if ((R.x2-len<x && x<R.x2+1) && (R.y-1<y && y<R.y+len)) {
7171
//Srch
7272
Bangle.removeListener("touch", touchHandler);
7373
Bangle.removeListener("swipe", swipeHandler);
7474
E.showMenu(searchMenu);
7575
} else if ((R.x2-len<x && x<R.x2+1) && (R.y2-len<y && y<R.y2+1)) {
76-
//Speed
76+
//Speed
7777
Bangle.removeListener("touch", touchHandler);
7878
Bangle.removeListener("swipe", swipeHandler);
7979
E.showMenu(speedMenu);
8080
} else if ((R.x-1<x && x<R.x+len) && (R.y+R.h/2-len/2<y && y<R.y+R.h/2+len/2)) {
81-
//Previous
81+
//Previous
8282
btMsg("service", standardCls, "player.previoustrack");
8383
} else if ((R.x2-len+1<x && x<R.x2+1) && (R.y+R.h/2-len/2<y && y<R.y+R.h/2+len/2)) {
8484
//Next
@@ -117,7 +117,7 @@ let setUI = function() {
117117
);
118118
Bangle.on("touch", touchHandler);
119119
Bangle.on("swipe", swipeHandler);
120-
let buttonHandler = setWatch(()=>{load();}, BTN, {edge:'falling'});
120+
let buttonHandler = setWatch(()=>{Bangle.load();}, BTN, {edge:'falling'});
121121
};
122122

123123
/*
@@ -218,7 +218,7 @@ let paMenu = {
218218
gadgetbridgeWake();
219219
gadgetbridgeWake();
220220
},
221-
"Exit PA Remote": ()=>{load();}
221+
"Exit PA Remote": ()=>{Bangle.load();}
222222
};
223223

224224

@@ -257,7 +257,7 @@ let controlMenu = {
257257
btMsg("service", updateCls, "update");
258258
},
259259
"Messages Music Controls": () => {
260-
load("messagesmusic.app.js");
260+
Bangle.load("messagesmusic.app.js");
261261
},
262262
};
263263

apps/podadrem/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "podadrem",
33
"name": "Podcast Addict Remote",
44
"shortName": "PA Remote",
5-
"version": "0.11",
5+
"version": "0.12",
66
"author": "thyttan",
77
"description": "Control Podcast Addict on your android device.",
88
"readme": "README.md",

apps/qcenter/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
0.03: Adds a setting for going back to clock on a timeout
44
0.04: Fix timeouts closing fast loaded apps
55
0.05: Minor code improvements
6+
0.06: Enable fast load with Bangle.load

0 commit comments

Comments
 (0)