initial commit
This commit is contained in:
44
source/Background/IBackground.mc
Normal file
44
source/Background/IBackground.mc
Normal file
@ -0,0 +1,44 @@
|
||||
import Toybox.Graphics;
|
||||
import Toybox.Lang;
|
||||
import Toybox.WatchUi;
|
||||
|
||||
class IBackground extends Drawable {
|
||||
|
||||
var Marks as Array<IMark> = [];
|
||||
|
||||
typedef BackgroundParams as {
|
||||
:Identifier as Object,
|
||||
};
|
||||
|
||||
enum BackgroundStyleType {
|
||||
SOLID_BACKGROUND,
|
||||
}
|
||||
|
||||
static function getBackground(style as BackgroundStyleType) as IBackground {
|
||||
switch (style) {
|
||||
case SOLID_BACKGROUND:
|
||||
default:
|
||||
return new SolidBackground({});
|
||||
}
|
||||
}
|
||||
|
||||
function initialize(options as BackgroundParams) {
|
||||
Drawable.initialize({:identifier => options[:Identifier]});
|
||||
|
||||
for (var s = 0; s < 60; s += 5) {
|
||||
var mark = IMark.getMark(IMark.DOT_MARK, {:Seconds => s});
|
||||
if (mark != null) {
|
||||
Marks.add(mark);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function draw(dc as Dc) as Void {
|
||||
drawBackground(dc);
|
||||
for (var i = 0; i < Marks.size(); ++i) {
|
||||
Marks[i].draw(dc);
|
||||
}
|
||||
}
|
||||
|
||||
function drawBackground(dc as Dc) as Void {}
|
||||
}
|
||||
Reference in New Issue
Block a user