fix: fixed widget positioning for rounded corners, fixed logo
This commit is contained in:
parent
e8062061b4
commit
a75ffcbfb8
4
app.json
4
app.json
@ -6,7 +6,7 @@
|
||||
"appType": "watchface",
|
||||
"version": {
|
||||
"code": 1,
|
||||
"name": "1.0.0"
|
||||
"name": "1.0.1"
|
||||
},
|
||||
"icon": "icon.png",
|
||||
"vender": "zepp",
|
||||
@ -31,7 +31,7 @@
|
||||
"path": "watchface/index",
|
||||
"main": 1,
|
||||
"editable": 0,
|
||||
"lockscreen": 0,
|
||||
"lockscreen": 1,
|
||||
"hightCost": 0
|
||||
}
|
||||
},
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 9.2 KiB |
BIN
assets/logo.png
Normal file
BIN
assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
@ -3,15 +3,16 @@ import * as hmUI from '@zos/ui'
|
||||
import fontArray from '../fontData/secondaryFont'
|
||||
|
||||
let batteryWg;
|
||||
|
||||
const moduleX = 310
|
||||
const moduleY = 10
|
||||
export default function(){
|
||||
console.log("[modules]: battery module init")
|
||||
let battery = new hmSensor.Battery()
|
||||
updateBatteryWidget(battery.getCurrent())
|
||||
battery.onChange(() => updateBatteryWidget(battery.getCurrent()))
|
||||
hmUI.createWidget(hmUI.widget.IMG, {
|
||||
x: 355,
|
||||
y: 10,
|
||||
x: moduleX,
|
||||
y: moduleY,
|
||||
src: 'date/perc.PNG'
|
||||
})
|
||||
}
|
||||
@ -20,8 +21,8 @@ function updateBatteryWidget(batteryPercentage){
|
||||
hmUI.deleteWidget(batteryWg)
|
||||
}
|
||||
batteryWg = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
||||
x: 270,
|
||||
y: 10,
|
||||
x: moduleX - 85,
|
||||
y: moduleY,
|
||||
type: hmUI.data_type.BATTERY,
|
||||
font_array: fontArray,
|
||||
h_space: 1,
|
||||
|
@ -1,23 +1,26 @@
|
||||
import * as hmUI from '@zos/ui'
|
||||
import fontArray from '../fontData/secondaryFont'
|
||||
const moduleX = 50
|
||||
const moduleY = 10
|
||||
|
||||
export default function () {
|
||||
console.log("[modules]: date module init")
|
||||
hmUI.createWidget(hmUI.widget.IMG_DATE, {
|
||||
day_startX: 10,
|
||||
day_startY: 10,
|
||||
day_startX: moduleX,
|
||||
day_startY: moduleY,
|
||||
day_align: hmUI.align.LEFT,
|
||||
day_space: 0,
|
||||
day_zero: 1,
|
||||
day_en_array: fontArray
|
||||
})
|
||||
hmUI.createWidget(hmUI.widget.IMG, {
|
||||
x: 54,
|
||||
y: 14,
|
||||
x: moduleX + 44,
|
||||
y: moduleY + 4,
|
||||
src: 'date/point.PNG'
|
||||
})
|
||||
hmUI.createWidget(hmUI.widget.IMG_DATE, {
|
||||
month_startX: 70,
|
||||
month_startY: 10,
|
||||
month_startX: moduleX + 60,
|
||||
month_startY: moduleY,
|
||||
month_align: hmUI.align.LEFT,
|
||||
month_space: 0,
|
||||
month_zero: 1,
|
||||
|
@ -3,14 +3,16 @@ import * as hmUI from '@zos/ui';
|
||||
import secondaryFont from '../fontData/secondaryFont';
|
||||
|
||||
let distWg;
|
||||
const moduleX = 50
|
||||
const moduleY = 405
|
||||
export default function(){
|
||||
console.log("[modules]: distance module init")
|
||||
let distance = new hmSensor.Distance();
|
||||
updateDistance(distance.getCurrent())
|
||||
distance.onChange(() => updateDistance(distance.getCurrent()))
|
||||
hmUI.createWidget(hmUI.widget.IMG, {
|
||||
x: 10,
|
||||
y: 405,
|
||||
x: moduleX,
|
||||
y: moduleY,
|
||||
src: 'misc/dist.PNG'
|
||||
})
|
||||
}
|
||||
@ -24,8 +26,8 @@ function updateDistance(dist){
|
||||
}
|
||||
dist = (dist * 1000).toFixed(0)
|
||||
distWg = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
||||
x: 160,
|
||||
y: 405,
|
||||
x: moduleX + 150,
|
||||
y: moduleY,
|
||||
type: hmUI.data_type.DISTANCE,
|
||||
font_array: secondaryFont,
|
||||
h_space: 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user