1
0
Fork 0

start a skeleton folder

- my-great-app
- my-gread-widget
master
MaBecker 2019-11-15 18:15:49 +01:00
parent 406ac50c1d
commit a8f0481faa
8 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,12 @@
// Create an entry in apps.json as follows:
{ "id": "7chname",
"name": "My app's human readable name",
"icon": "my-great-app.png",
"description": "A detailed description of my great app",
"tags": "",
"storage": [
{"name":"+7chname","url":"my-great-app.json"},
{"name":"-7chname","url":"my-great-app.js"},
{"name":"*7chname","url":"my-great-app-icon.js","evaluate":true}
],
}

View File

@ -0,0 +1,13 @@
/*
use the Espruino image converter @ https://www.espruino.com/Image+Converter
settings x Use Compression?
x Transparency?
Defusion: flat
Colours: 1 bit, 4 bit or 8 bit Web Palette
Output as: Image String
Copy result and replace sample below
*/
require("heatshrink").decompress(atob("mEwwJC/AH4A/AH4AgA=="))

35
skeleton/my-great-app.js Normal file
View File

@ -0,0 +1,35 @@
/* jshint esversion: 6 */
/*
the screen area(0,0,239,23) is reserved for wigdets
*/
(() => {
// section for const and vars if needed
...
// section for functions, classes
...
function < your main function > ()
}
// special function to handle display switch on
Bangle.on('lcdPower', (on) => {
if (on) {
drawWidgets();
<your main function>();;
}
});
// clear screen and launch
g.clear();
<your main funtion>();
})();

View File

@ -0,0 +1,5 @@
{
"name":"Short Name",
"icon":"*7chname",
"src":"-7chname"
}

BIN
skeleton/my-great-app.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

View File

@ -0,0 +1,15 @@
/*
widget area is 24 pixel high and 239 width : (0,0,239,23)
*/
(() => {
// const data, var or image
function draw() {
...
}
WIDGETS["your widget name"] = { draw: draw };
})()

View File

@ -0,0 +1,4 @@
{
"name":"widgetname", "type":"widget",
"src":"-7chname"
}

BIN
skeleton/my-great-widget.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B