diff --git a/elaborate/README.md b/elaborate/README.md index 066b14b..861dd84 100644 --- a/elaborate/README.md +++ b/elaborate/README.md @@ -26,7 +26,7 @@ One of the default watchfaces for CMF by Nothing Watch [Elaborate 2](https://int **Model compatibility:** Amazfit GTR Mini (round, 416 x 416 pixels) / GTR 4 / T-Rex 2 and other round watches with ZeppOS 2+ -**AOD:** No +**AOD:** Yes **Tap-zones:** No diff --git a/elaborate/app.json b/elaborate/app.json index cb90e38..69b907f 100644 --- a/elaborate/app.json +++ b/elaborate/app.json @@ -5,8 +5,8 @@ "appName": "Elaborate", "appType": "watchface", "version": { - "code": 9, - "name": "1.3.2" + "code": 10, + "name": "1.4.0" }, "icon": "icon.png", "vender": "novvember", diff --git a/elaborate/assets/common.r/background/aod.png b/elaborate/assets/common.r/background/aod.png new file mode 100644 index 0000000..8f07e20 Binary files /dev/null and b/elaborate/assets/common.r/background/aod.png differ diff --git a/elaborate/utils/constants.js b/elaborate/utils/constants.js index 7bea2d9..607ffea 100644 --- a/elaborate/utils/constants.js +++ b/elaborate/utils/constants.js @@ -18,6 +18,7 @@ export const COLORS = { bgOnAccent: 0x000000, textPrimary: 0x000000, textSecondary: 0xebebed, + aod: 0xebebed, }; export const FONT_FAMILY = { @@ -53,33 +54,33 @@ export const DATE_TEXT = { textSize: px(18), months: isRusLang ? [ - 'Янв', - 'Фев', - 'Мар', - 'Апр', - 'Май', - 'Июн', - 'Июл', - 'Авг', - 'Сен', - 'Окт', - 'Ноя', - 'Дек', - ] + 'Янв', + 'Фев', + 'Мар', + 'Апр', + 'Май', + 'Июн', + 'Июл', + 'Авг', + 'Сен', + 'Окт', + 'Ноя', + 'Дек', + ] : [ - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'May', - 'Jun', - 'Jul', - 'Aug', - 'Sep', - 'Oct', - 'Nov', - 'Dec', - ], + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ], }; export const DATE_WEEK = { diff --git a/elaborate/watchface/index.js b/elaborate/watchface/index.js index c67cb2c..229bdfe 100644 --- a/elaborate/watchface/index.js +++ b/elaborate/watchface/index.js @@ -37,6 +37,8 @@ import { SLEEP_WAKE_STAGE_ARC_PROPS, WEATHER_NO_ICON_TEXT_PROPS, PULSE_PREV_POINTER_GROUP_PROPS, + BACKGROUND_AOD_IMAGE_PROPS, + TIME_AOD_TEXT_PROPS, } from './index.r.layout'; import { decline } from '../utils/decline'; import { formatNumber } from '../utils/formatNumber'; @@ -53,6 +55,8 @@ WatchFace({ build() { console.log('index page.js on build invoke'); + this.buildBackground(); + this.buildSleep(); this.buildDate(); this.buildSeconds(); @@ -71,6 +75,10 @@ WatchFace({ console.log('index page.js on destroy invoke'); }, + buildBackground() { + hmUI.createWidget(hmUI.widget.IMG, BACKGROUND_AOD_IMAGE_PROPS); + }, + buildSleep() { const noDataWidget = hmUI.createWidget(hmUI.widget.IMG, SLEEP_NO_DATA_IMAGE_PROPS); const arcWidget = hmUI.createWidget(hmUI.widget.ARC_PROGRESS, null); @@ -205,6 +213,7 @@ WatchFace({ buildTime() { hmUI.createWidget(hmUI.widget.FILL_RECT, TIME_BACKGROUND_PROPS); const textWidget = hmUI.createWidget(hmUI.widget.TEXT, TIME_TEXT_PROPS); + const textAodWidget = hmUI.createWidget(hmUI.widget.TEXT, TIME_AOD_TEXT_PROPS); const is12HourFormat = hmSetting.getTimeFormat() === 0; let prevTime = ''; @@ -223,6 +232,7 @@ WatchFace({ prevTime = timeString; textWidget.setProperty(hmUI.prop.TEXT, timeString); + textAodWidget.setProperty(hmUI.prop.TEXT, timeString); }; hmUI.createWidget(hmUI.widget.WIDGET_DELEGATE, { @@ -232,6 +242,9 @@ WatchFace({ if (hmSetting.getScreenType() == hmSetting.screen_type.WATCHFACE) { updateTimer = timer.createTimer(1000, 1000, update); update(); + } else if (hmSetting.getScreenType() == hmSetting.screen_type.AOD) { + updateTimer = timer.createTimer(3000, 3000, update); + update(); } }, pause_call: () => { diff --git a/elaborate/watchface/index.r.layout.js b/elaborate/watchface/index.r.layout.js index 3819f49..635cac6 100644 --- a/elaborate/watchface/index.r.layout.js +++ b/elaborate/watchface/index.r.layout.js @@ -7,6 +7,7 @@ import { FONT_FAMILY, FONT_SIZE, PULSE, + SCREEN, SECONDS, SLEEP, STEPS, @@ -14,6 +15,15 @@ import { WEATHER, } from '../utils/constants'; +export const BACKGROUND_AOD_IMAGE_PROPS = { + x: 0, + y: 0, + w: SCREEN.width, + h: SCREEN.height, + src: 'background/aod.png', + show_level: hmUI.show_level.ONAL_AOD, +}; + export const SLEEP_NO_DATA_IMAGE_PROPS = { x: SLEEP.x, y: SLEEP.y, @@ -126,6 +136,12 @@ export const TIME_TEXT_PROPS = { show_level: hmUI.show_level.ONLY_NORMAL, }; +export const TIME_AOD_TEXT_PROPS = { + ...TIME_TEXT_PROPS, + color: COLORS.aod, + show_level: hmUI.show_level.ONAL_AOD, +}; + export const WEATHER_BACKGROUND_PROPS = { x: WEATHER.x, y: WEATHER.y,