Skip to content

Commit 90370ec

Browse files
author
Matus Misiak
committed
2 parents ab76882 + 12e0be6 commit 90370ec

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

watchface/index.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,25 @@ WatchFace({
244244
makeProgress(i, EDIT_TYPES.indexOf(groups[i].getProperty(hmUI.prop.CURRENT_TYPE)))
245245
}
246246
for (let i of PROGRESSES.keys()) {
247-
hmUI.createWidget(hmUI.widget.IMG_CLICK, {
248-
x: [0, DW/2][i % 2],
249-
y: [0, DH-DW/2-I_SIZE-I_SPACE_V][Math.floor(i/2) % 2],
250-
w: DW/2,
251-
h: DW/2+I_SIZE+I_SPACE_V,
252-
type: groups[i].getProperty(hmUI.prop.CURRENT_TYPE)
253-
})
247+
if (groups[i].getProperty(hmUI.prop.CURRENT_TYPE) === hmUI.data_type.PAI_WEEKLY) {
248+
hmUI.createWidget(hmUI.widget.IMG, {
249+
x: [0, DW / 2][i % 2],
250+
y: [0, DH - DW / 2 - I_SIZE - I_SPACE_V][Math.floor(i / 2) % 2],
251+
w: DW / 2,
252+
h: DW / 2 + I_SIZE + I_SPACE_V,
253+
//type: groups[i].getProperty(hmUI.prop.CURRENT_TYPE)
254+
}).addEventListener(hmUI.event.CLICK_UP, function (info) {
255+
hmApp.startApp({ url: 'pai_app_Screen', native: true })
256+
});
257+
} else {
258+
hmUI.createWidget(hmUI.widget.IMG_CLICK, {
259+
x: [0, DW / 2][i % 2],
260+
y: [0, DH - DW / 2 - I_SIZE - I_SPACE_V][Math.floor(i / 2) % 2],
261+
w: DW / 2,
262+
h: DW / 2 + I_SIZE + I_SPACE_V,
263+
type: groups[i].getProperty(hmUI.prop.CURRENT_TYPE)
264+
})
265+
}
254266
}
255267

256268
// Center widget

0 commit comments

Comments
 (0)