From 0e05d97056da8e77cfa45c1aa4541cd6929f08dd Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 11 May 2023 10:27:27 +0100 Subject: [PATCH] example update --- apps/_example_app/README.md | 5 ++++ apps/_example_clkinfo/ChangeLog | 1 + apps/_example_clkinfo/README.md | 27 ++++++++++++++++++ apps/_example_clkinfo/clkinfo.js | 16 +++++++++++ .../widget.png => _example_clkinfo/icon.png} | Bin apps/_example_clkinfo/metadata.json | 14 +++++++++ apps/_example_widget/README.md | 2 ++ apps/_example_widget/icon.png | Bin 0 -> 1620 bytes apps/_example_widget/metadata.json | 2 +- apps/_example_widget/widget.js | 16 +++++------ 10 files changed, 73 insertions(+), 10 deletions(-) create mode 100644 apps/_example_clkinfo/ChangeLog create mode 100644 apps/_example_clkinfo/README.md create mode 100644 apps/_example_clkinfo/clkinfo.js rename apps/{_example_widget/widget.png => _example_clkinfo/icon.png} (100%) create mode 100644 apps/_example_clkinfo/metadata.json create mode 100644 apps/_example_widget/icon.png diff --git a/apps/_example_app/README.md b/apps/_example_app/README.md index dc139bc9a..eff3919c6 100644 --- a/apps/_example_app/README.md +++ b/apps/_example_app/README.md @@ -1,5 +1,10 @@ # App Name +More information on making apps: + +* http://www.espruino.com/Bangle.js+First+App +* http://www.espruino.com/Bangle.js+App+Loader + Describe the app... Add screen shots (if possible) to the app folder and link then into this file with ![](.png) diff --git a/apps/_example_clkinfo/ChangeLog b/apps/_example_clkinfo/ChangeLog new file mode 100644 index 000000000..4c21f3ace --- /dev/null +++ b/apps/_example_clkinfo/ChangeLog @@ -0,0 +1 @@ +0.01: New Widget! diff --git a/apps/_example_clkinfo/README.md b/apps/_example_clkinfo/README.md new file mode 100644 index 000000000..3d5970e39 --- /dev/null +++ b/apps/_example_clkinfo/README.md @@ -0,0 +1,27 @@ +# Clock Info Name + +More info on making Clock Infos and what they are: http://www.espruino.com/Bangle.js+Clock+Info + +Describe the clock info... + +Add screen shots (if possible) to the app folder and link then into this file with ![](.png) + +## Usage + +Describe how to use it + +## Features + +Name the function + +## Controls + +Name the buttons and what they are used for + +## Requests + +Name who should be contacted for support/update requests + +## Creator + +Your name diff --git a/apps/_example_clkinfo/clkinfo.js b/apps/_example_clkinfo/clkinfo.js new file mode 100644 index 000000000..b653709ce --- /dev/null +++ b/apps/_example_clkinfo/clkinfo.js @@ -0,0 +1,16 @@ +(function() { + return { + name: "Bangle", + // img: 24x24px image for this list of items. The default "Bangle" list has its own image so this is not needed + items: [ + { name : "Item1", + get : function() { return { text : "TextOfItem1", + // v : 10, min : 0, max : 100, - optional + img : atob("GBiBAAAAAAAAAAAYAAD/AAOBwAYAYAwAMAgAEBgAGBAACBCBCDHDjDCBDBAACBAACBhCGAh+EAwYMAYAYAOBwAD/AAAYAAAAAAAAAA==") }}, + show : function() {}, + hide : function() {}, + // run : function() {} optional (called when tapped) + } + ] + }; +}) // must not have a semi-colon! \ No newline at end of file diff --git a/apps/_example_widget/widget.png b/apps/_example_clkinfo/icon.png similarity index 100% rename from apps/_example_widget/widget.png rename to apps/_example_clkinfo/icon.png diff --git a/apps/_example_clkinfo/metadata.json b/apps/_example_clkinfo/metadata.json new file mode 100644 index 000000000..83b8184d8 --- /dev/null +++ b/apps/_example_clkinfo/metadata.json @@ -0,0 +1,14 @@ +{ "id": "7chname", + "name": "My clock info's human readable name", + "shortName":"Short Name", + "version":"0.01", + "description": "A detailed description of my clock info", + "icon": "icon.png", + "type": "clkinfo", + "tags": "clkinfo", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "storage": [ + {"name":"7chname.clkinfo.js","url":"clkinfo.js"} + ] +} diff --git a/apps/_example_widget/README.md b/apps/_example_widget/README.md index a909e9e7e..c786d3be8 100644 --- a/apps/_example_widget/README.md +++ b/apps/_example_widget/README.md @@ -1,5 +1,7 @@ # Widget Name +More info on making Widgets and what they are: http://www.espruino.com/Bangle.js+Widgets + Describe the app... Add screen shots (if possible) to the app folder and link then into this file with ![](.png) diff --git a/apps/_example_widget/icon.png b/apps/_example_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N3wt_Ze(10?J@%{C2grBk42hsu74qEo^nd&v`X`IHN9lrxzS~GeF S(*#!l0000 { - function draw() { - g.reset(); // reset the graphics context to defaults (color/font/etc) - // add your code - g.drawString("X", this.x, this.y); - } - // add your widget WIDGETS["mywidget"]={ area:"tl", // tl (top left), tr (top right), bl (bottom left), br (bottom right), be aware that not all apps support widgets at the bottom of the screen width: 28, // how wide is the widget? You can change this and call Bangle.drawWidgets() to re-layout - draw:draw // called to draw the widget + draw:function() { + g.reset(); // reset the graphics context to defaults (color/font/etc) + // add your code + g.drawString("X", this.x, this.y); + } // called to draw the widget }; })()