using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
class SandboxView extends Ui.WatchFace {
var updateCount = 0;
var enterSleepCount = 0;
var exitSleepCount = 0;
function onLayout(dc) {
}
function onUpdate(dc) {
var string;
dc.setColor( Gfx.COLOR_BLACK, Gfx.COLOR_BLACK );
dc.clear();
dc.setColor( Gfx.COLOR_WHITE, Gfx.COLOR_TRANSPARENT );
string = "Updates: " + updateCount;
dc.drawText( 40, 10, Gfx.FONT_MEDIUM, string, Gfx.TEXT_JUSTIFY_LEFT );
string = "Enter sleep: " + enterSleepCount;
dc.drawText( 40, 40, Gfx.FONT_MEDIUM, string, Gfx.TEXT_JUSTIFY_LEFT );
string = "Exit sleep: " + exitSleepCount;
dc.drawText( 40, 70, Gfx.FONT_MEDIUM, string, Gfx.TEXT_JUSTIFY_LEFT );
if(updateCount % 2 != 0) {
Ui.requestUpdate();
}
updateCount++;
}
//! The user has just looked at their watch. Timers and animations may be started here.
function onExitSleep() {
exitSleepCount++;
}
//! Terminate any active timers and prepare for slow updates.
function onEnterSleep() {
enterSleepCount++;
}
}