Simple layout extended and trying load data
parent
95a2927b99
commit
38de17bccf
|
|
@ -2,16 +2,53 @@
|
||||||
Bangle.loadWidgets();
|
Bangle.loadWidgets();
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
|
|
||||||
|
const settings = require("Storage").readJSON("coin_info.settings.json", 1) || {};
|
||||||
|
const db = require("Storage").readJSON("coin_info.cmc_key.json", 1) || {};
|
||||||
|
let ticker = 0;
|
||||||
|
|
||||||
var Layout = require("Layout");
|
var Layout = require("Layout");
|
||||||
var layout = new Layout( {
|
var layout = new Layout({
|
||||||
type:"v", c: [
|
type:"v", c: [
|
||||||
{type:"txt", font:"20%", label:"12:00", id:"time" },
|
{type:"h",
|
||||||
{type:"txt", font:"6x8", label:"The Date", id:"date" }
|
c: [
|
||||||
|
{type:"txt", id:"tknName", label:"Load...", halign:"left"},
|
||||||
|
{type:"btn", label:"...", halign:"right", cb: l=>{}}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{type:"txt", id:"tknGraph", font:"20%", label:"12:00", id:"time" },
|
||||||
|
{type:"h",
|
||||||
|
c: [
|
||||||
|
{type:"btn", label:"07", cb: l=>{}},
|
||||||
|
{type:"btn", label:"14", cb: l=>{}},
|
||||||
|
{type:"btn", label:"30", cb: l=>{}},
|
||||||
|
{type:"btn", label:"60", cb: l=>{}}
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
});
|
}, { lazy:true });
|
||||||
|
layout.update();
|
||||||
|
|
||||||
|
// timeout used to update every minute
|
||||||
|
var drawTimeout;
|
||||||
|
// update the screen
|
||||||
|
function draw() {
|
||||||
|
//
|
||||||
|
layout.tknName.label = settings.tokenSelected[ticker];
|
||||||
|
layout.render();
|
||||||
|
|
||||||
|
// schedule a draw for the next minute
|
||||||
|
if (drawTimeout) clearTimeout(drawTimeout);
|
||||||
|
drawTimeout = setTimeout(function() {
|
||||||
|
drawTimeout = undefined;
|
||||||
|
draw();
|
||||||
|
}, 60000 - (Date.now() % 60000));
|
||||||
|
}
|
||||||
|
|
||||||
|
// update time and draw
|
||||||
g.clear();
|
g.clear();
|
||||||
layout.render();
|
draw();
|
||||||
|
|
||||||
|
//
|
||||||
Bangle.setUI({
|
Bangle.setUI({
|
||||||
mode : 'custom',
|
mode : 'custom',
|
||||||
back : Bangle.showClock,
|
back : Bangle.showClock,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{ "id": "coin_info",
|
{ "id": "coin_info",
|
||||||
"name": "Crypto-Coins Info",
|
"name": "Crypto-Coins Info",
|
||||||
"shortName":"Coins Info",
|
"shortName":"Coins Info",
|
||||||
"version": "0.06.00",
|
"version": "0.06.01",
|
||||||
"description": "Crypto-Coins Infos with the help of the Binance API",
|
"description": "Crypto-Coins Infos with the help of the Binance API",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "clkinfo",
|
"tags": "clkinfo",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue