From: Caisking <3449750381@qq.com> Date: Mon, 8 Apr 2024 12:53:32 +0000 (+0800) Subject: defultdial设置为KUMI X-Git-Tag: release_V1.2.70_20241020_135402~1200^2~11^2~4 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=58611e76aa1d7354ecac1949ad2051d3cc69dc0b;p=mirrors%2FFD230.git defultdial设置为KUMI --- diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h index 145e1c2f7..099d9c026 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h @@ -62,7 +62,9 @@ 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 "/dial_soures/KUMI.bin"; + static constexpr const char *DEFAULT_DIALPER_PATH = APP_RES_PATH "/dial_soures/KUMIVIEW.bin"; + static constexpr const char *DEFAULT_DIALBACK_PATH = APP_RES_PATH "/dial_soures/background.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/HeartCard.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 114c20222..fa71f0efc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/clock/src/MainClockView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/clock/src/MainClockView.cpp @@ -307,13 +307,45 @@ namespace OHOS bool MainClockView::InitSweepClock(void) { + curFace = new UIImageView(); + if (curFace == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "curFace new fail"); + return false; + } + curFace->SetPosition(0, 0); + ImageInfo *image = ImageCacheManager::GetInstance().LoadSingleRes(DEFAULT_DIALBACK_PATH, false); + if (image == nullptr) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "LoadAllDialFromRam loadimage %s fail", + DEFAULT_DIALBACK_PATH); + return false; + } + curFace->SetSrc(image); + Add(curFace); #if 0 - curFace = new UIImageView(); - if (curFace == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "curFace new fail"); - return false; - } - curFace->SetPosition(0, 0); + // Add SweepClock to App + if (mainSweepClock == nullptr) + { + mainSweepClock = new UISweepClock(); + } + mainSweepClock->SetPosition(0, 0); // widget's left position and top position + mainSweepClock->Resize(466, 466); // widget's width and height + mainSweepClock->SetViewId("sweepClock1"); // Set style + mainSweepClock->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + mainSweepClock->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + // Set additional property + mainSweepClock->SetWorkMode(UISweepClock::WorkMode::NORMAL); + mainSweepClock->SetHandLine(UISweepClock::HandType::HOUR_HAND, {233, 101}, {0, 132}, Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0xff), 5, 132, 255); + mainSweepClock->SetHandLine(UISweepClock::HandType::MINUTE_HAND, {233, 56}, {0, 177}, Color::GetColorFromRGBA(0x00, 0xff, 0x00, 0xff), 3, 177, 255); + mainSweepClock->SetHandLine(UISweepClock::HandType::SECOND_HAND, {233, 10}, {0, 223}, Color::GetColorFromRGBA(0xff, 0x00, 0x00, 0xff), 1, 223, 255); + uint16_t sweepClock1realMilliSecond = 40 * 1000; + mainSweepClock->SetSweepTime12Hour(10, 20, sweepClock1realMilliSecond, true); + + mainSweepClock->SetInitTime24Hour(0, 0, 0); + mainSweepClock->SetWorkMode(UISweepClock::WorkMode::NORMAL); + InitDateTime(); if (LoadClockImage(curFace, CLOCK_CLOCK0) == false) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "curFace LoadClockImage CLOCK_MAIN_FACE_IMAGE fail"); @@ -394,11 +426,13 @@ namespace OHOS { return false; } + // mainSweepClock->Add(curFace); + // Add(mainSweepClock); +#if 0 mainSweepClock->Add(stepLabel); mainSweepClock->Add(weekLabel); mainSweepClock->Add(heartRateLabel); mainSweepClock->Add(stepLabel); -#if 0 mainSweepClock->Add(curFace); mainSweepClock->Add(stepLabel); mainSweepClock->Add(heartRate); @@ -406,9 +440,7 @@ namespace OHOS mainSweepClock->Add(heartRateLabel); mainSweepClock->Add(weekDay); mainSweepClock->Add(progress); - c Add(mainSweepClock); - mainSweepClock->SetDragParentInstead(true); mainSweepClock->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialPresenter.cpp index a29bf9c43..41bb3f48e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_dial/src/SetDialPresenter.cpp @@ -60,7 +60,7 @@ namespace OHOS // 目前暂时这样处理 if (pageIndex == 0) { - model->SaveDialSetting(1); + model->SaveDialSetting(0); } else { diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/KUMI.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dial_soures/KUMI.bin similarity index 100% rename from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/KUMI.bin rename to code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dial_soures/KUMI.bin diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/KUMIVIEW.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dial_soures/KUMIVIEW.bin similarity index 100% rename from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/KUMIVIEW.bin rename to code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dial_soures/KUMIVIEW.bin diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dial_soures/background.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dial_soures/background.bin new file mode 100644 index 000000000..1469df65f Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/dial_soures/background.bin differ