From 60f8a69b429d47142d24d6132bb9432b43181274 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=A2=81=E6=B8=85=E6=A2=A6?= <3449750381@qq.com> Date: Mon, 26 Aug 2024 11:48:20 +0000 Subject: [PATCH] Merge #791 into sdk602patch0626 from refs/changes/791/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 袁清梦 * refs/changes/791/head: (3 commits squashed) - 屏蔽不使用的字体注册 - 修改自定义表盘可配置Id(1~5) - 关闭表盘Model类型打印 Signed-off-by: Caisking <3449750381@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/791 --- .../wearable/fd230app/nativelauncher/include/UiConfig.h | 3 +++ .../wearable/fd230app/nativelauncher/src/NativeLauncher.cpp | 6 ++++-- .../wearable/fd230app/nativeui/main/src/MainModel.cpp | 1 + .../fd230app/nativeui/main/src/dial/DialViewGroup.cpp | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h index c023335ef..bc1392af2 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h @@ -38,6 +38,7 @@ namespace OHOS DIAL_CLOCK_2 = 2, DIAL_CLOCK_3 = 3, DIAL_CLOCK_4 = 4, + DIAL_CLOCK_5 = 5, DIAL_MAX, } DialId; @@ -89,6 +90,8 @@ namespace OHOS static constexpr const char *CUSTOM_CLOCK3_DIALPER_PATH = APP_CUSTOM_DIAL_PATH "/3/thumbnail.bin"; static constexpr const char *CUSTOM_CLOCK4_DIALBACK_PATH = APP_CUSTOM_DIAL_PATH "/4/main_bg.bin"; static constexpr const char *CUSTOM_CLOCK4_DIALPER_PATH = APP_CUSTOM_DIAL_PATH "/4/thumbnail.bin"; + static constexpr const char *CUSTOM_CLOCK5_DIALBACK_PATH = APP_CUSTOM_DIAL_PATH "/5/main_bg.bin"; + static constexpr const char *CUSTOM_CLOCK5_DIALPER_PATH = APP_CUSTOM_DIAL_PATH "/5/thumbnail.bin"; /* -------------------------------------------------------------------------- */ /*卡片管理*/ static constexpr const char *PNG_SET_CARD_ADD = APP_RES_PATH "/MainCard/CARD_ADD.bin"; diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index f46d76568..73563069c 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -459,9 +459,11 @@ namespace OHOS // ConfigModel::GetInstance()->Init(); // 初始化语言 GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME); - GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::NEW_FONT_DIR, GILROY_BOLD_FONT); // 注册字体 + GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::NEW_FONT_DIR, GILROY_BOLD_FONT); // 注册字体 +#if 0 GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::NEW_FONT_DIR, SHEEPING_CATS_FONT); // 注册字体 GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::NEW_FONT_DIR, GILROY_REGULAR_FONT); // 注册字体 +#endif WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "NativeLauncher::InitNativeLauncher"); /* -------------------------------------------------------------------------- */ @@ -1520,7 +1522,7 @@ namespace OHOS void NativeLauncher::InitScheduleSlice(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitScheduleSlice"); - SliceProxy * t_View = new AbilitySliceProxy; + SliceProxy *t_View = new AbilitySliceProxy; if (nullptr == t_View) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "View is nullptr"); diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainModel.cpp index 0cd452184..448cfaec3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainModel.cpp @@ -53,6 +53,7 @@ namespace OHOS {DIAL_CLOCK_2, "Custom_2", CUSTOM_CLOCK2_DIALPER_PATH, DEFAULT_TASK_PERIOD}, // 表盘 Id 2 {DIAL_CLOCK_3, "Custom_3", CUSTOM_CLOCK3_DIALPER_PATH, DEFAULT_TASK_PERIOD}, // 表盘 Id 3 {DIAL_CLOCK_4, "Custom_4", CUSTOM_CLOCK4_DIALPER_PATH, DEFAULT_TASK_PERIOD}, // 表盘 Id 4 + {DIAL_CLOCK_5, "Custom_5", CUSTOM_CLOCK5_DIALPER_PATH, DEFAULT_TASK_PERIOD}, // 表盘 Id 4 }; const CardInfo printfMap[] = { {HEART_RATE, "心率卡片"}, diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialViewGroup.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialViewGroup.cpp index 5906b5ce7..2406141b0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialViewGroup.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/dial/DialViewGroup.cpp @@ -141,7 +141,7 @@ namespace OHOS if (!resLoadStatus) { /*打印已经注册的表盘model类型*/ - ModelDialDataFactory::GetInstance().DumpModules(); + // ModelDialDataFactory::GetInstance().DumpModules(); resLoadStatus = true; } uint32_t elapseTime = HALTick::GetInstance().GetElapseTime(startTime_); -- 2.17.1