From: Caisking <3449750381@qq.com> Date: Mon, 8 Apr 2024 09:31:15 +0000 (+0800) Subject: 修改defult表盘 X-Git-Tag: release_V1.2.70_20241020_135402~1200^2~23 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=4736bb7f8b22bad135ef15063473be2784c1663b;p=mirrors%2FFD230.git 修改defult表盘 --- diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h index bd5bc82dd..8da3798b4 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h @@ -62,7 +62,7 @@ namespace OHOS #define APP_DIAL_PATH "/user/dial" /* ---------------------------------- 卡片管理 --------------------------------- */ static constexpr const char *CARD_CONFIG_PATH = "/user/cardconfig.bin"; - static constexpr const char *DEFAULT_DIAL_PATH = APP_RES_PATH "KUMI.bin"; + static constexpr const char *DEFAULT_DIAL_PATH = APP_RES_PATH "/KUMI.bin"; static constexpr const char *PNG_SET_CARD_ADD = APP_RES_PATH "/MainCard/CARD_ADD.bin"; static constexpr const char *PNG_SET_CARD_DEL = APP_RES_PATH "/MainCard/CARD_DEL.bin"; static constexpr const char *PNG_SET_CARD_HEART = APP_RES_PATH "/MainCard/HeartCrad.bin"; diff --git a/code/sdk/application/wearable/fd230app/nativeui/clock/src/MainClockView.cpp b/code/sdk/application/wearable/fd230app/nativeui/clock/src/MainClockView.cpp index 974434b43..f720ce03c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/clock/src/MainClockView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/clock/src/MainClockView.cpp @@ -109,6 +109,7 @@ namespace OHOS void MainClockView::InitStepValue() { +#if 0 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue"); uint32_t stepValue; int weekToday = ActivityModel::GetInstance()->GetWeekToday(); @@ -128,6 +129,7 @@ namespace OHOS stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::RELEASED); stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::PRESSED); stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::INACTIVE); +#endif } bool MainClockView::InitLabelView(void) @@ -187,6 +189,7 @@ namespace OHOS bool MainClockView::InitCenterCircleView(void) { +#if 0 bigCircle = new Image(); if (bigCircle == nullptr) { @@ -219,11 +222,13 @@ namespace OHOS { return false; } +#endif return true; } bool MainClockView::InitHandView(void) { +#if 0 secondHand = new Image(); if (secondHand == nullptr) { @@ -266,11 +271,13 @@ namespace OHOS { return false; } +#endif return true; } bool MainClockView::LoadClockImage(Image *view, uint32_t resId) { +#if 0 std::string file = CLOCK_IAMGES; ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId, file); if (image == nullptr) @@ -279,11 +286,13 @@ namespace OHOS return false; } view->SetSrc(image); +#endif return true; } bool MainClockView::LoadClockImage(UIImageView *view, uint32_t resId) { +#if 0 std::string file = CLOCK_IAMGES; ImageInfo *image = ImageCacheManager::GetInstance().LoadOneInMultiRes(resId, file); if (image == nullptr) @@ -292,6 +301,7 @@ namespace OHOS return false; } view->SetSrc(image); +#endif return true; } @@ -383,7 +393,7 @@ namespace OHOS { return false; } - +#if 0 mainSweepClock->Add(curFace); mainSweepClock->Add(stepLabel); mainSweepClock->Add(heartRate); @@ -414,20 +424,24 @@ namespace OHOS mainSweepClock->SetInitTime24Hour(0, 0, 0); mainSweepClock->SetWorkMode(UISweepClock::WorkMode::NORMAL); InitDateTime(); +#endif SetCoverable(true); return true; } void MainClockView::RefreshStep(int step) { +#if 0 char stepChar[STEP_CHAR_NUM] = {0}; (void)sprintf_s(stepChar, STEP_CHAR_NUM, "%d", step); stepLabel->SetText(stepChar); +#endif } void MainClockView::RefreshHeartRate(int value) { +#if 0 if (value == 0) { heartRateLabel->SetText("--"); @@ -437,6 +451,7 @@ namespace OHOS (void)sprintf_s(heartRateChar, STEP_CHAR_NUM, "%d", value); heartRateLabel->SetText(heartRateChar); +#endif } void MainClockView::InitDateTime(void) diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp index aa8af4cc2..7c5fe662f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/MainViewSample.cpp @@ -319,6 +319,7 @@ namespace OHOS { DialViewGroup *dial = new DialViewGroup(); dial->SetDial(setting.dialFullName); + // dial->SetDial(DEFAULT_DIAL_PATH); return dial; } UICardPage *MainViewSample::InitWathDial(DialSetting &setting) @@ -327,9 +328,7 @@ namespace OHOS { case DIAL_CLOCK: { - DialViewGroup *dial = new DialViewGroup(); - dial->SetDial(DEFAULT_DIAL_PATH); - return dial; + return new MainClockView(); } break; // 添加 break 语句 default: @@ -347,7 +346,6 @@ namespace OHOS { mainClockView = InitWathDial(setting); } - if (mainClockView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView new fail");