Initial commit
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
bin/
|
||||||
|
out/
|
||||||
35
manifest.xml
Normal file
35
manifest.xml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. -->
|
||||||
|
<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq">
|
||||||
|
<!--
|
||||||
|
Use "Monkey C: Edit Application" from the Visual Studio Code command palette
|
||||||
|
to update the application attributes.
|
||||||
|
-->
|
||||||
|
<iq:application id="fc9470b4-7618-417f-a876-3f78dd941006" type="watchface" name="@Strings.AppName" entry="terminalfaceApp" launcherIcon="@Drawables.LauncherIcon" minApiLevel="3.2.0">
|
||||||
|
<!--
|
||||||
|
Use the following from the Visual Studio Code comand palette to edit
|
||||||
|
the build targets:
|
||||||
|
"Monkey C: Set Products by Version" - Lets you add all producs that meet the
|
||||||
|
minimum SDK version of the application
|
||||||
|
"Monkey C: Edit Products" - Lets you add or remove any product
|
||||||
|
-->
|
||||||
|
<iq:products>
|
||||||
|
<iq:product id="fenix6pro"/>
|
||||||
|
</iq:products>
|
||||||
|
<!--
|
||||||
|
Use "Monkey C: Edit Permissions" from the Visual Studio Code command
|
||||||
|
palette to update permissions.
|
||||||
|
-->
|
||||||
|
<iq:permissions/>
|
||||||
|
<!--
|
||||||
|
Use "Monkey C: Edit Languages" from the Visual Studio Code command
|
||||||
|
palette to edit your compatible language list.
|
||||||
|
-->
|
||||||
|
<iq:languages/>
|
||||||
|
<!--
|
||||||
|
Use "Monkey C: Configure Monkey Barrel" from the Visual Studio Code
|
||||||
|
command palette to edit the included barrels.
|
||||||
|
-->
|
||||||
|
<iq:barrels/>
|
||||||
|
</iq:application>
|
||||||
|
</iq:manifest>
|
||||||
1
monkey.jungle
Executable file
1
monkey.jungle
Executable file
@@ -0,0 +1 @@
|
|||||||
|
project.manifest = manifest.xml
|
||||||
3
resources/drawables/drawables.xml
Executable file
3
resources/drawables/drawables.xml
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
<drawables>
|
||||||
|
<bitmap id="LauncherIcon" filename="launcher_icon.png" />
|
||||||
|
</drawables>
|
||||||
BIN
resources/drawables/launcher_icon.png
Executable file
BIN
resources/drawables/launcher_icon.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
101
resources/fonts/input.fnt
Normal file
101
resources/fonts/input.fnt
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
info face="InputMono" size=24 bold=1 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
|
||||||
|
common lineHeight=24 base=19 scaleW=256 scaleH=256 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0
|
||||||
|
page id=0 file="input_0.png"
|
||||||
|
chars count=97
|
||||||
|
char id=0 x=113 y=18 width=1 height=1 xoffset=0 yoffset=0 xadvance=0 page=0 chnl=15
|
||||||
|
char id=13 x=253 y=0 width=1 height=1 xoffset=0 yoffset=0 xadvance=0 page=0 chnl=15
|
||||||
|
char id=32 x=251 y=0 width=1 height=1 xoffset=0 yoffset=0 xadvance=13 page=0 chnl=15
|
||||||
|
char id=33 x=31 y=52 width=6 height=15 xoffset=3 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=34 x=19 y=69 width=10 height=9 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=35 x=181 y=0 width=13 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=36 x=126 y=0 width=12 height=16 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=37 x=14 y=20 width=13 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=38 x=28 y=20 width=13 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=39 x=250 y=48 width=5 height=9 xoffset=4 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=40 x=90 y=0 width=9 height=19 xoffset=2 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=41 x=60 y=0 width=9 height=19 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=42 x=74 y=52 width=12 height=12 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=43 x=87 y=52 width=11 height=12 xoffset=1 yoffset=6 xadvance=13 page=0 chnl=15
|
||||||
|
char id=44 x=39 y=66 width=7 height=9 xoffset=3 yoffset=14 xadvance=13 page=0 chnl=15
|
||||||
|
char id=45 x=79 y=65 width=11 height=3 xoffset=1 yoffset=11 xadvance=13 page=0 chnl=15
|
||||||
|
char id=46 x=72 y=65 width=6 height=5 xoffset=3 yoffset=14 xadvance=13 page=0 chnl=15
|
||||||
|
char id=47 x=24 y=0 width=11 height=19 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=48 x=72 y=36 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=49 x=120 y=34 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=50 x=156 y=32 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=51 x=94 y=20 width=12 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=52 x=209 y=0 width=13 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=53 x=107 y=20 width=12 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=54 x=60 y=36 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=55 x=228 y=32 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=56 x=171 y=16 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=57 x=240 y=32 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=58 x=12 y=69 width=6 height=11 xoffset=3 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=59 x=23 y=53 width=7 height=15 xoffset=3 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=60 x=49 y=52 width=10 height=13 xoffset=1 yoffset=6 xadvance=13 page=0 chnl=15
|
||||||
|
char id=61 x=60 y=65 width=11 height=8 xoffset=1 yoffset=9 xadvance=13 page=0 chnl=15
|
||||||
|
char id=62 x=38 y=52 width=10 height=13 xoffset=1 yoffset=6 xadvance=13 page=0 chnl=15
|
||||||
|
char id=63 x=68 y=20 width=12 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=64 x=113 y=0 width=12 height=17 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=65 x=195 y=0 width=13 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=66 x=183 y=16 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=67 x=195 y=16 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=68 x=207 y=16 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=69 x=219 y=16 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=70 x=231 y=16 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=71 x=243 y=16 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=72 x=0 y=37 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=73 x=12 y=37 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=74 x=120 y=18 width=12 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=75 x=81 y=20 width=12 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=76 x=12 y=53 width=10 height=15 xoffset=2 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=77 x=42 y=20 width=12 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=78 x=36 y=36 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=79 x=159 y=16 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=80 x=0 y=53 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=81 x=0 y=0 width=11 height=20 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=82 x=133 y=17 width=12 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=83 x=55 y=20 width=12 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=84 x=223 y=0 width=13 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=85 x=48 y=36 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=86 x=237 y=0 width=13 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=87 x=167 y=0 width=13 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=88 x=153 y=0 width=13 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=89 x=139 y=0 width=13 height=15 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=90 x=24 y=36 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=91 x=70 y=0 width=9 height=19 xoffset=2 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=92 x=12 y=0 width=11 height=19 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=93 x=100 y=0 width=8 height=19 xoffset=2 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=94 x=60 y=52 width=13 height=12 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=95 x=91 y=65 width=11 height=3 xoffset=1 yoffset=20 xadvance=13 page=0 chnl=15
|
||||||
|
char id=96 x=30 y=69 width=8 height=9 xoffset=2 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=97 x=113 y=52 width=13 height=11 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=98 x=84 y=36 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=99 x=0 y=69 width=11 height=11 xoffset=1 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=100 x=96 y=36 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=101 x=166 y=48 width=11 height=11 xoffset=1 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=102 x=108 y=36 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=103 x=0 y=21 width=13 height=15 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=104 x=132 y=34 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=105 x=144 y=33 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=106 x=80 y=0 width=9 height=19 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=107 x=168 y=32 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=108 x=180 y=32 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=109 x=127 y=50 width=12 height=11 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=110 x=178 y=48 width=11 height=11 xoffset=1 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=111 x=190 y=48 width=11 height=11 xoffset=1 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=112 x=192 y=32 width=11 height=15 xoffset=1 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=113 x=204 y=32 width=11 height=15 xoffset=1 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=114 x=202 y=48 width=11 height=11 xoffset=1 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=115 x=214 y=48 width=11 height=11 xoffset=1 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=116 x=216 y=32 width=11 height=15 xoffset=1 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=117 x=226 y=48 width=11 height=11 xoffset=1 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=118 x=140 y=50 width=12 height=11 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=119 x=99 y=52 width=13 height=11 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=120 x=153 y=49 width=12 height=11 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=121 x=146 y=16 width=12 height=15 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=122 x=238 y=48 width=11 height=11 xoffset=1 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
|
char id=123 x=36 y=0 width=11 height=19 xoffset=0 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=124 x=109 y=0 width=3 height=19 xoffset=5 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=125 x=48 y=0 width=11 height=19 xoffset=2 yoffset=4 xadvance=13 page=0 chnl=15
|
||||||
|
char id=126 x=47 y=66 width=12 height=8 xoffset=0 yoffset=8 xadvance=13 page=0 chnl=15
|
||||||
3
resources/fonts/input.xml
Normal file
3
resources/fonts/input.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<fonts>
|
||||||
|
<font id="id_font_input" filename="input.fnt" antialias="true"/>
|
||||||
|
</fonts>
|
||||||
BIN
resources/fonts/input_0.png
Normal file
BIN
resources/fonts/input_0.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
BIN
resources/fonts/input_1.png
Normal file
BIN
resources/fonts/input_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
3
resources/layouts/layout.xml
Executable file
3
resources/layouts/layout.xml
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
<layout id="WatchFace">
|
||||||
|
<label id="prompt1" x="left" y="center" font="@Fonts.id_font_input" justification="Graphics.TEXT_JUSTIFY_LEFT" color="Graphics.COLOR_BLUE" />
|
||||||
|
</layout>
|
||||||
3
resources/strings/strings.xml
Normal file
3
resources/strings/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<strings>
|
||||||
|
<string id="AppName">terminalface</string>
|
||||||
|
</strings>
|
||||||
28
source/terminalfaceApp.mc
Normal file
28
source/terminalfaceApp.mc
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import Toybox.Application;
|
||||||
|
import Toybox.Lang;
|
||||||
|
import Toybox.WatchUi;
|
||||||
|
|
||||||
|
class terminalfaceApp extends Application.AppBase {
|
||||||
|
|
||||||
|
function initialize() {
|
||||||
|
AppBase.initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
// onStart() is called on application start up
|
||||||
|
function onStart(state as Dictionary?) as Void {
|
||||||
|
}
|
||||||
|
|
||||||
|
// onStop() is called when your application is exiting
|
||||||
|
function onStop(state as Dictionary?) as Void {
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the initial view of your application here
|
||||||
|
function getInitialView() as Array<Views or InputDelegates>? {
|
||||||
|
return [ new terminalfaceView() ] as Array<Views or InputDelegates>;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getApp() as terminalfaceApp {
|
||||||
|
return Application.getApp() as terminalfaceApp;
|
||||||
|
}
|
||||||
152
source/terminalfaceView.mc
Normal file
152
source/terminalfaceView.mc
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
import Toybox.Graphics;
|
||||||
|
import Toybox.Lang;
|
||||||
|
import Toybox.System;
|
||||||
|
import Toybox.WatchUi;
|
||||||
|
import Toybox.Time.Gregorian;
|
||||||
|
|
||||||
|
using Toybox.ActivityMonitor;
|
||||||
|
|
||||||
|
class terminalfaceView extends WatchUi.WatchFace {
|
||||||
|
private var font as FontResource?;
|
||||||
|
private var curY as Number?;
|
||||||
|
private var lineSpace as Number?;
|
||||||
|
private var blinking as Boolean?;
|
||||||
|
private var lastBlink as Boolean?;
|
||||||
|
|
||||||
|
function initialize() {
|
||||||
|
WatchFace.initialize();
|
||||||
|
font = WatchUi.loadResource(Rez.Fonts.id_font_input) as FontResource;
|
||||||
|
lineSpace = 23;
|
||||||
|
blinking = false;
|
||||||
|
lastBlink = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load your resources here
|
||||||
|
function onLayout(dc as Dc) as Void {
|
||||||
|
setLayout(Rez.Layouts.WatchFace(dc));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when this View is brought to the foreground. Restore
|
||||||
|
// the state of this View and prepare it to be shown. This includes
|
||||||
|
// loading resources into memory.
|
||||||
|
function onShow() as Void {
|
||||||
|
}
|
||||||
|
|
||||||
|
private function prompt(dc as Dc, cmd as String) as Void {
|
||||||
|
dc.setColor(Graphics.COLOR_GREEN, Graphics.COLOR_TRANSPARENT);
|
||||||
|
dc.drawText(25, curY, font, "si", Graphics.TEXT_JUSTIFY_LEFT);
|
||||||
|
|
||||||
|
dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_TRANSPARENT);
|
||||||
|
dc.drawText(50, curY, font, "@", Graphics.TEXT_JUSTIFY_LEFT);
|
||||||
|
|
||||||
|
dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_TRANSPARENT);
|
||||||
|
dc.drawText(63, curY, font, "fnx", Graphics.TEXT_JUSTIFY_LEFT);
|
||||||
|
|
||||||
|
dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_TRANSPARENT);
|
||||||
|
dc.drawText(113, curY, font, "~>", Graphics.TEXT_JUSTIFY_LEFT);
|
||||||
|
|
||||||
|
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
|
||||||
|
dc.drawText(150, curY, font, Lang.format("$1$", [cmd]), Graphics.TEXT_JUSTIFY_LEFT);
|
||||||
|
|
||||||
|
curY += lineSpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function response(dc as Dc, text as String) as Void {
|
||||||
|
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
|
||||||
|
dc.drawText(25, curY, font, text, Graphics.TEXT_JUSTIFY_LEFT);
|
||||||
|
|
||||||
|
curY += lineSpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function makeBatteryString() {
|
||||||
|
var stats = System.getSystemStats();
|
||||||
|
var batteryLevel = stats.battery;
|
||||||
|
var batteryDays = stats.batteryInDays;
|
||||||
|
|
||||||
|
var bar = new [10];
|
||||||
|
for (var i = 0; i < 10; i += 1)
|
||||||
|
{
|
||||||
|
if (batteryLevel > i*10)
|
||||||
|
{
|
||||||
|
bar[i] = '#';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bar[i] = '-';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bar.add(batteryDays.toNumber());
|
||||||
|
|
||||||
|
return Lang.format("[$1$$2$$3$$4$$5$$6$$7$$8$$9$$10$] ($11$d)", bar);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the view
|
||||||
|
function onUpdate(dc as Dc) as Void {
|
||||||
|
curY = 50;
|
||||||
|
|
||||||
|
dc.setColor(Graphics.COLOR_TRANSPARENT, Graphics.COLOR_BLACK);
|
||||||
|
dc.clear();
|
||||||
|
|
||||||
|
prompt(dc, "date");
|
||||||
|
|
||||||
|
var today = Gregorian.info(Time.now(), Time.FORMAT_MEDIUM);
|
||||||
|
var dateString = Lang.format("$1$ $2$ $3$ $4$:$5$",
|
||||||
|
[
|
||||||
|
today.day_of_week,
|
||||||
|
today.month,
|
||||||
|
today.day,
|
||||||
|
today.hour.format("%02d"),
|
||||||
|
today.min.format("%02d"),
|
||||||
|
]);
|
||||||
|
|
||||||
|
response(dc, dateString);
|
||||||
|
|
||||||
|
prompt(dc, "steps");
|
||||||
|
var info = ActivityMonitor.getInfo();
|
||||||
|
var steps = info.steps.toFloat();
|
||||||
|
var stepGoal = info.stepGoal.toFloat();
|
||||||
|
var ratio = (steps/stepGoal)*100;
|
||||||
|
response(dc, Lang.format("$1$/$2$ ($3$%)", [steps.toNumber(), stepGoal.toNumber(), ratio.toNumber()]));
|
||||||
|
|
||||||
|
prompt(dc, "battery");
|
||||||
|
var batteryString = makeBatteryString();
|
||||||
|
response(dc, batteryString);
|
||||||
|
|
||||||
|
if (blinking)
|
||||||
|
{
|
||||||
|
if (lastBlink)
|
||||||
|
{
|
||||||
|
prompt(dc, "");
|
||||||
|
lastBlink = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prompt(dc, "_");
|
||||||
|
lastBlink = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prompt(dc, "_");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when this View is removed from the screen. Save the
|
||||||
|
// state of this View here. This includes freeing resources from
|
||||||
|
// memory.
|
||||||
|
function onHide() as Void {
|
||||||
|
}
|
||||||
|
|
||||||
|
// The user has just looked at their watch. Timers and animations may be started here.
|
||||||
|
function onExitSleep() as Void {
|
||||||
|
blinking = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Terminate any active timers and prepare for slow updates.
|
||||||
|
function onEnterSleep() as Void {
|
||||||
|
blinking = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user