Merge bangle 1 and 2 welcome screens

pull/869/head
Gordon Williams 2021-10-28 14:28:30 +01:00
parent e96d7cc57a
commit 577bcd39b1
10 changed files with 8 additions and 85 deletions

View File

@ -169,17 +169,18 @@
}, },
{ {
"id": "welcome", "id": "welcome",
"name": "Welcome (Bangle.js 1)", "name": "Welcome",
"shortName": "Welcome", "shortName": "Welcome",
"version": "0.12", "version": "0.13",
"description": "Appears at first boot and explains how to use Bangle.js", "description": "Appears at first boot and explains how to use Bangle.js",
"icon": "app.png", "icon": "app.png",
"tags": "start,welcome", "tags": "start,welcome",
"supports": ["BANGLEJS"], "supports": ["BANGLEJS","BANGLEJS2"],
"allow_emulator": true, "allow_emulator": true,
"storage": [ "storage": [
{"name":"welcome.boot.js","url":"boot.js"}, {"name":"welcome.boot.js","url":"boot.js"},
{"name":"welcome.app.js","url":"app.js"}, {"name":"welcome.app.js","url":"app-bangle1.js","supports": ["BANGLEJS"]},
{"name":"welcome.app.js","url":"app-bangle2.js","supports": ["BANGLEJS2"]},
{"name":"welcome.settings.js","url":"settings.js"}, {"name":"welcome.settings.js","url":"settings.js"},
{"name":"welcome.img","url":"app-icon.js","evaluate":true} {"name":"welcome.img","url":"app-icon.js","evaluate":true}
], ],
@ -203,24 +204,6 @@
], ],
"data": [{"name":"mywelcome.json"}] "data": [{"name":"mywelcome.json"}]
}, },
{
"id": "welcome2",
"name": "Welcome (Bangle.js 2)",
"shortName": "Welcome",
"version": "0.13",
"description": "Appears at first boot and explains how to use Bangle.js 2",
"icon": "app.png",
"tags": "start,welcome",
"supports": ["BANGLEJS2"],
"allow_emulator": true,
"storage": [
{"name":"welcome2.boot.js","url":"boot.js"},
{"name":"welcome2.app.js","url":"app.js"},
{"name":"welcome2.settings.js","url":"settings.js"},
{"name":"welcome2.img","url":"app-icon.js","evaluate":true}
],
"data": [{"name":"welcome2.json"}]
},
{ {
"id": "gbridge", "id": "gbridge",
"name": "Gadgetbridge", "name": "Gadgetbridge",

View File

@ -14,3 +14,4 @@
0.10: Tweaks to reduce memory usage 0.10: Tweaks to reduce memory usage
0.11: Fix initial screen fill colour 0.11: Fix initial screen fill colour
0.12: Fix swipe direction (#800) 0.12: Fix swipe direction (#800)
0.13: Mods for Bangle.js 2

View File

@ -290,14 +290,6 @@ setWatch(()=>{
}, BTN2, {repeat:true,edge:"falling"}); }, BTN2, {repeat:true,edge:"falling"});
setWatch(()=>move(-1), BTN1, {repeat:true}); setWatch(()=>move(-1), BTN1, {repeat:true});
(function migrateSettings(){
let global_settings = require('Storage').readJSON('setting.json', 1)
if (global_settings) {
delete global_settings.welcomed
require('Storage').write('setting.json', global_settings)
}
})()
Bangle.setLCDTimeout(0); Bangle.setLCDTimeout(0);
Bangle.setLCDPower(1); Bangle.setLCDPower(1);
move(0); move(0);

View File

@ -243,14 +243,6 @@ setWatch(()=>{
move(1); move(1);
}, BTN1, {repeat:true}); }, BTN1, {repeat:true});
(function migrateSettings(){
let global_settings = require('Storage').readJSON('setting.json', 1)
if (global_settings) {
delete global_settings.welcomed
require('Storage').write('setting.json', global_settings)
}
})()
Bangle.setLCDTimeout(0); Bangle.setLCDTimeout(0);
Bangle.setLCDPower(1); Bangle.setLCDPower(1);
move(0); move(0);

View File

@ -1,17 +0,0 @@
0.01: New App!
0.02: Animate balloon intro
0.03: BTN3 now won't restart when at the end
0.04: Fix regression after tweaks to Storage.readJSON
0.05: Move configuration into App/widget settings
0.06: Move loader into welcome.boot.js
0.07: Run again when updated
Don't run again when settings app is updated (or absent)
Add "Run Now" option to settings
0.08: Don't overwrite existing settings on app update
0.09: Allow welcome to run after a fresh install
More useful app menu
BTN2 now goes to menu on release
0.10: Tweaks to reduce memory usage
0.11: Fix initial screen fill colour
0.12: Fix swipe direction (#800)
0.13: Mods for Bangle.js 2

View File

@ -1 +0,0 @@
require("heatshrink").decompress(atob("mEwxH+AH4A/AH4AU5gAEFtoxnEwXN53WAAXO5oJB42Wy26AAIueFoPXFggAD4AwEGTQiB6otBFgwAD3QvFGC5dCFxiRGGClhrdbv67BXAIuLMBIwPsIABF4OpLwXOFxjBCF6gtBw2r1mHXoXWFxqQWFwOH62rL4IeB6xeOAAIvHGBYuC6+rR4QvCXpovXw3X1i/DR4QuPR5AvKFQOs6+GF4eod4IvPd5AvLwvWLwQvCv4fBR54vURwOHF4iQCX0yOCF4aQBX0QvHSAoAN3SOSd4WyF4yQPLyhgD1YvDMCJeIFxhgCF47BN4BeHFxpgDSAiRORpAuPMIYAFGBYuaF5aSHFwQvEFqQwOeggSBLa4xNF4X+4wAC/xeCFjIADrYwGBIIvlMQiPDBAOk0gDBz2XF8BlEF4eIxADFF8lcF9n+wIrFF05bHF9AsGF9wupGAYv/F8QupGAov/F/4wOF1gA/AH4Ap"))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,9 +0,0 @@
(function() {
let s = require('Storage').readJSON('welcome2.json', 1) || {};
if (!s.welcomed) {
setTimeout(() => {
require('Storage').write('welcome2.json', {welcomed: true})
load('welcome2.app.js')
})
}
})()

View File

@ -1,18 +0,0 @@
(function(back) {
let settings = require('Storage').readJSON('welcome2.json', 1)
|| require('Storage').readJSON('setting.json', 1) || {}
E.showMenu({
'': { 'title': 'Welcome App' },
'Run next boot': {
value: !settings.welcomed,
format: v => v ? 'Yes' : 'No',
onchange: v => require('Storage').write('welcome2.json', {welcomed: !v}),
},
'Run Now': () => load('welcome2.app.js'),
'Turn off & run next': () => {
require('Storage').write('welcome2.json', {welcomed: false});
Bangle.off();
},
'< Back': back,
})
})

View File

@ -133,9 +133,9 @@ apps.forEach((app,appIdx) => {
if (isGlob(file.name)) ERROR(`App ${app.id} storage file ${file.name} contains wildcards`); if (isGlob(file.name)) ERROR(`App ${app.id} storage file ${file.name} contains wildcards`);
let char = file.name.match(FORBIDDEN_FILE_NAME_CHARS) let char = file.name.match(FORBIDDEN_FILE_NAME_CHARS)
if (char) ERROR(`App ${app.id} storage file ${file.name} contains invalid character "${char[0]}"`) if (char) ERROR(`App ${app.id} storage file ${file.name} contains invalid character "${char[0]}"`)
if (fileNames.includes(file.name)) if (fileNames.includes(file.name) && !file.supports) // assume that there aren't duplicates if 'supports' is set
ERROR(`App ${app.id} file ${file.name} is a duplicate`); ERROR(`App ${app.id} file ${file.name} is a duplicate`);
if (!file.supports) fileNames.push(file.name); // assume that there aren't duplicates if 'supports' is set fileNames.push(file.name);
allFiles.push({app: app.id, file: file.name}); allFiles.push({app: app.id, file: file.name});
if (file.url) if (!fs.existsSync(appDir+file.url)) ERROR(`App ${app.id} file ${file.url} doesn't exist`); if (file.url) if (!fs.existsSync(appDir+file.url)) ERROR(`App ${app.id} file ${file.url} doesn't exist`);
if (!file.url && !file.content && !app.custom) ERROR(`App ${app.id} file ${file.name} has no contents`); if (!file.url && !file.content && !app.custom) ERROR(`App ${app.id} file ${file.name} has no contents`);