From 41e62561d072f844f55f4a43d8e597c7c941c38d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=A2=81=E6=B8=85=E6=A2=A6?= <3449750381@qq.com> Date: Wed, 26 Jun 2024 10:17:40 +0000 Subject: [PATCH] Merge #380 into sdk602patch0521 from refs/changes/380/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 删除部分文件 * refs/changes/380/head: (3 commits squashed) - 删除部分文件 - 心率血氧卡片优化 - Merge branch 'sdk602patch0521' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0521 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/380 --- .../wearable/fd230app/CMakeLists.txt | 3 +- .../nativelauncher/include/AppViewIDs.h | 1 + .../nativelauncher/include/NativeLauncher.h | 1 + .../nativelauncher/src/NativeLauncher.cpp | 4 +- .../bloodoxygen/src/BloodOxygenView.cpp | 4 +- .../heart_blood/{src => }/BloodCardView.cpp | 49 ++++---- .../heart_blood/{include => }/BloodCardView.h | 8 +- .../health_service/health_service.cpp | 2 +- .../heart_blood/include/HeartCardView.h | 0 .../include/HeartControlPresenter.h | 0 .../heart_blood/include/HeartControlView.h | 0 .../heart_blood/include/HeartFrequencyView.h | 0 .../heart_blood/include/HeartUnusualView.h | 0 .../heart_blood/src/HeartCardView.cpp | 0 .../heart_blood/src/HeartControlPresenter.cpp | 0 .../heart_blood/src/HeartControlView.cpp | 0 .../heart_blood/src/HeartFrequencyView.cpp | 0 .../heart_blood/src/HeartUnusualView.cpp | 0 .../nativeui/heartrate/src/HeartRateView.cpp | 107 +++++++++++++++++- .../nativeui/heartrate/src/HeartView.cpp | 2 +- .../nativeui/main/include/MainViewSample.h | 2 +- .../nativeui/set_card/src/SetMainView.cpp | 16 +-- .../nativeui/sleep/src/SleepCardView.cpp | 11 +- .../training_card/src/Training_CardView.cpp | 16 ++- 24 files changed, 169 insertions(+), 57 deletions(-) rename code/sdk/application/wearable/fd230app/nativeui/heart_blood/{src => }/BloodCardView.cpp (84%) rename code/sdk/application/wearable/fd230app/nativeui/heart_blood/{include => }/BloodCardView.h (81%) delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartCardView.h delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartControlPresenter.h delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartControlView.h delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartFrequencyView.h delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartUnusualView.h delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartCardView.cpp delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartControlPresenter.cpp delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartControlView.cpp delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartFrequencyView.cpp delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartUnusualView.cpp diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index cc4343ec9..26b8b4f4e 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -285,8 +285,7 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/key/src/KeyInputListener.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/screennotify/src/ui_screennotify.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heart_blood/src/BloodCardView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heart_blood/src/HeartCardView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heart_blood/BloodCardView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/heart_blood/health_service/health_service.cpp diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h index d46d2980d..3ef50537c 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h @@ -82,6 +82,7 @@ typedef enum : uint16_t VIEW_SET_CARD, // 卡片管理 VIEW_ADD_CARD, // 添加卡片 VIEW_SET_DIAL, // 切换表盘 + VIEW_SET_HEART, // 设置心率周期检测 /* ----------------------------------- 训练 ----------------------------------- */ VIEW_TRAINING, // 训练 VIEW_TRAININGNOMAL, // 正常训练开始界面(除骑行,健走,跑步外) diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h index 6e9fc2fdc..cb8cd11c3 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h @@ -75,6 +75,7 @@ namespace OHOS void InitMessageShowSlice(void); void InitTakePhotosSlice(void); void InitSleepSlice(void); + void InitSetHeartSlice(void); /* ----------------------------------- 训练 ----------------------------------- */ void InitTraingSlice(void); void InitTraingNomalSlice(void); diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 49a8290e4..b9a1a8c71 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -64,7 +64,7 @@ #include "UISampleView.h" #include "UISamplePresenter.h" -#include "heart_blood/include/BloodCardView.h" +#include "heart_blood/BloodCardView.h" #include "weather/include/MainWeatherPresenter.h" #include "weather/include/MainWeatherView.h" @@ -357,6 +357,8 @@ namespace OHOS {VIEW_SET_DIAL, &NativeLauncher::InitSetDialSlice}, /*睡眠界面*/ {VIEW_SLEEP, &NativeLauncher::InitSleepSlice}, + /*心率周期检测*/ + //{VIEW_SET_HEART, &NativeLauncher::InitSetHeartSlice}, /* -------------------------------------------------------------------------- */ #ifdef SUPPORT_ALIPAY_SEC diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenView.cpp index 6ee4c6ed9..d75edf6c0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenView.cpp @@ -88,7 +88,7 @@ namespace OHOS // 更新数据 std::string bloodoxygenStr = std::to_string(spo2); percent->SetText(bloodoxygenStr.c_str()); - + // 获取时间差 uint32_t time = BloodOxygenPresenter::GetInstance()->GetCurrentTime(); uint32_t check_time = BloodOxygenModel::GetInstance()->GetCheckTime(); @@ -100,7 +100,7 @@ namespace OHOS } else if (time_diff <= 60) { - UpdateLabel(timeLabel, time_diff,STR_CHECKNO); + UpdateLabel(timeLabel, time_diff, STR_CHECKTIME); } else { diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/BloodCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.cpp similarity index 84% rename from code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/BloodCardView.cpp rename to code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.cpp index 0bf068761..5e78deca0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/BloodCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.cpp @@ -1,5 +1,5 @@ -#include "heart_blood/include/BloodCardView.h" +#include "heart_blood/BloodCardView.h" #include "common/image_cache_manager.h" #include "UiConfig.h" #include "ui_resource_image.h" @@ -26,7 +26,6 @@ namespace OHOS BloodCardView::~BloodCardView() { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodCardView::~BloodCardView"); - RemoveAll(); DeInit(); g_pBloodCardView = nullptr; } @@ -40,22 +39,35 @@ namespace OHOS void BloodCardView::UpSPO2Text() { // 更新血氧数据 - uint16_t spo2_ = BloodOxygenModel::GetInstance()->GetSPO2data(); - if (spo2_ != 0) // 判断是否为默认数据 + uint16_t spo2 = BloodOxygenModel::GetInstance()->GetSPO2data(); + if (spo2 != 0) // 判断是否为默认数据 { // 更新数据 - std::string bloodoxygenStr = std::to_string(spo2_); + std::string bloodoxygenStr = std::to_string(spo2); bloodLabel->SetText(bloodoxygenStr.c_str()); - // 更新时间 + + // 获取时间差 uint32_t time = BloodOxygenPresenter::GetInstance()->GetCurrentTime(); uint32_t check_time = BloodOxygenModel::GetInstance()->GetCheckTime(); - std::string TimeStr = BloodOxygenPresenter::GetInstance()->GetTDOA(time, check_time) + "检测"; - timeLabel->SetText(TimeStr.c_str()); + int time_diff = BloodOxygenPresenter::GetInstance()->GetTDOA(time, check_time); + + if (time_diff == 0) + { + timeLabel->SetTextId(STR_CHECKNEW); + } + else if (time_diff <= 60) + { + UpdateLabel(timeLabel, time_diff, STR_CHECKTIME); + } + else + { + timeLabel->SetTextId(STR_CHECKLONG); + } } else { bloodLabel->SetText("--"); - timeLabel->SetText("暂无检测结果"); + timeLabel->SetTextId(STR_CHECKNO); } } @@ -105,7 +117,7 @@ namespace OHOS Add(bloodLabel); /* -------------------------------------------------------------------------- */ - timeLabel = new UILabel(); + timeLabel = new UILabelExt(); if (timeLabel == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodOxygenView::new timeLabel fail"); @@ -115,19 +127,6 @@ namespace OHOS timeLabel->Resize(280, 100); // widget's width and height timeLabel->SetViewId("label1"); // Set style timeLabel->SetStyle(STYLE_TEXT_FONT, 30); - if (bloodoxygen != 0) - { - // 更新时间 - uint32_t time = BloodOxygenPresenter::GetInstance()->GetCurrentTime(); - uint32_t check_time = BloodOxygenModel::GetInstance()->GetCheckTime(); - std::string TimeStr = BloodOxygenPresenter::GetInstance()->GetTDOA(time, check_time) + "检测"; - timeLabel->SetText(TimeStr.c_str()); - } - else - { - timeLabel->SetText("暂无测量记录"); - } - /* -------------------------------------------------------------------------- */ timeLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); timeLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); timeLabel->SetRollSpeed(0); @@ -136,6 +135,8 @@ namespace OHOS // Add to rootView Add(timeLabel); + UpSPO2Text(); + // Add Label to App if (titleLabel == nullptr) { @@ -259,7 +260,6 @@ namespace OHOS void BloodCardView::UnLoad(void) { -#if 0 if (resLoadStatus) { ImageInfo *img = nullptr; @@ -267,7 +267,6 @@ namespace OHOS ImageCacheManager::GetInstance().UnloadOneInMultiRes(BLOODOXYGEN_BACKGOUND, BLOOD_IAMGES); resLoadStatus = false; } -#endif } /* -------------------------------------------------------------------------- */ } diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/BloodCardView.h b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.h similarity index 81% rename from code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/BloodCardView.h rename to code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.h index 68841c390..6751d5556 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/BloodCardView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.h @@ -1,3 +1,9 @@ +/*** + * @Date: 2024-06-26 16:13:19 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-06-26 16:52:01 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.h + */ #ifndef _Blood_CARD_VIEW_H #define _Blood_CARD_VIEW_H @@ -50,7 +56,7 @@ namespace OHOS UILabelButton *monitorButton = nullptr; UILabel *titleLabel = nullptr; UILabel *bloodLabel = nullptr; - UILabel *timeLabel = nullptr; + UILabelExt *timeLabel = nullptr; bool viewiInitStatus{false}; bool resLoadStatus{false}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp index 250a49e2c..a0ce16690 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp @@ -220,7 +220,7 @@ namespace OHOS } cJSON *SPO2 = cJSON_GetObjectItemCaseSensitive(latestData, "value"); - if (SPO2 == nullptr && cJSON_IsNumber(SPO2)) + if (SPO2 == nullptr && !cJSON_IsNumber(SPO2)) { // Add spo2_latest_data cJSON_AddItemToObject(latestData, "value", cJSON_CreateNumber(data.SPO2)); diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartCardView.h b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartCardView.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartControlPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartControlPresenter.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartControlView.h b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartControlView.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartFrequencyView.h b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartFrequencyView.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartUnusualView.h b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/include/HeartUnusualView.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartCardView.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartControlPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartControlPresenter.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartControlView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartControlView.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartFrequencyView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartFrequencyView.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartUnusualView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/src/HeartUnusualView.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartRateView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartRateView.cpp index 4cf64b21a..422e5243e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartRateView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartRateView.cpp @@ -612,7 +612,6 @@ namespace OHOS viewiInitStatus = true; } } - if (!resLoadStatus) { ScreenModels::GetInstance()->LoadAppImages(HEART_IAMGES, imageViewTop, HEART_HEARTRATE_TOP); @@ -865,4 +864,110 @@ namespace OHOS } } } +#if 0 +#ifdef __cplusplus + extern "C" + { +#endif + /* 定时器回调函数 */ + void HeartTimerCallback() + { + g_motionTimes++; + HeartCardPresenter *gHeartCardPresenter = HeartPresenter::GetInstance(); + if (gHeartCardPresenter == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartTimerCallback::gHeartCardPresenter new fail"); + return; + } + // gHeartCardPresenter->ModifiesTime(); + PRINT("HeartTimerCallback\r\n"); + } + + /* 开启定时器 */ + void InitTimer(void) + { + if (g_startCounting != NULL) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "HeartModel::HeartTimer already exists!!"); + return; + } + g_startCounting = osTimerNew((osTimerFunc_t)HeartTimerCallback, osTimerPeriodic, NULL, NULL); + if (g_startCounting == NULL) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartModel::HeartTimer osTimerNew failed!!"); + return; + } + int tick = osMs2Tick(MS_ONE_SECONDS); + osStatus_t retTimer = osTimerStart(g_startCounting, tick); + if (retTimer != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartModel::HeartTimer osTimerStart failed, ret = %lx!!", retTimer); + if (g_startCounting != NULL) + { + retTimer = osTimerDelete(g_startCounting); + if (retTimer != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartModel::osTimerDelete failed, ret = %lx!!", retTimer); + return; + } + g_startCounting = NULL; + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitTimer!"); + return; + } + } + /* 关闭定时器 */ + void DisableTimer(void) + { + if (g_startCounting != NULL) + { + osStatus_t ret = osTimerDelete(g_startCounting); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ScanTimerCallback osTimerDelete failed, ret = %lx!!", ret); + return; + } + g_startCounting = NULL; + PRINT("g_motionTimes:%d\r\n", sportdata->duration); + g_motionTimes = 0; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableTimer!"); + } + } + /* 暂停定时器 */ + void PauseTimer(void) + { + // 检查定时器是否存在 + if (g_startCounting != NULL) + { + // 暂停定时器,但不删除它 + osStatus_t ret = osTimerStop(g_startCounting); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StopWatch_PauseTimer osTimerStop failed, ret = %lx!!", ret); + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PauseTimer!"); + } + } + + /*恢复定时器*/ + void ResumeTimer(void) + { + // 检查定时器是否存在 + if (g_startCounting != NULL) + { + int tick = osMs2Tick(MS_ONE_SECONDS); + // 恢复定时器 + osStatus_t ret = osTimerStart(g_startCounting, tick); + if (ret != osOK) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ResumeTimer osTimerStart failed, ret = %lx!!", ret); + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ResumeTimer!"); + } + } + +#ifdef __cplusplus + } +#endif +#endif } // namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartView.cpp index 40eda2915..d0398a93b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartView.cpp @@ -115,7 +115,7 @@ namespace OHOS } else if (time_diff <= 60) { - UpdateLabel(timeLabel, time_diff, STR_CHECKNO); + UpdateLabel(timeLabel, time_diff, STR_CHECKTIME); } else { diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/MainViewSample.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/MainViewSample.h index 39faea926..df7632166 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/MainViewSample.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/MainViewSample.h @@ -32,7 +32,7 @@ #include "uicomponents/UIComponents.h" #include "SetCardModel.h" -#include "heart_blood/include/BloodCardView.h" +#include "heart_blood/BloodCardView.h" #include "traing/training_card/include/Training_CardView.h" // #include "ApplistCardView.h" #include "weather/include/WeatherControlView.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetMainView.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetMainView.cpp index 63bfdb3f6..3e5b12ef0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetMainView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetMainView.cpp @@ -1,3 +1,9 @@ +/*** + * @Date: 2024-06-11 20:17:37 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-06-26 11:25:56 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_card/src/SetMainView.cpp + */ /*** * @Date: 2024-06-11 20:17:37 * @LastEditors: Caisking 3449750381@qq.com @@ -31,7 +37,6 @@ namespace OHOS SetMainView::~SetMainView() { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetMainView::~SetMainView"); - RemoveAll(); DeInit(); g_pSetMainView = nullptr; } @@ -87,15 +92,6 @@ namespace OHOS } void SetMainView::UnLoad(void) { -#if 0 - if (resLoadStatus) - { - ImageInfo *img = nullptr; - background->SetSrc(img); - ImageCacheManager::GetInstance().UnloadOneInMultiRes(BLOODOXYGEN_BACKGOUND, BLOOD_IAMGES); - resLoadStatus = false; - } -#endif } /* -------------------------------------------------------------------------- */ } diff --git a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepCardView.cpp index 780c41cf6..62bb9a11e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepCardView.cpp @@ -1,3 +1,9 @@ +/*** + * @Date: 2024-06-25 10:41:40 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-06-26 11:27:04 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepCardView.cpp + */ #include "sleep/include/SleepCardView.h" #include "sleep/include/SleepControlView.h" #include "sleep/include/SleepControlPresenter.h" @@ -27,7 +33,7 @@ namespace OHOS delete sleepOnSwipeListener; sleepOnSwipeListener = nullptr; } - + if (sleepcontrolView != nullptr) { delete sleepcontrolView; @@ -62,7 +68,7 @@ namespace OHOS } SleepSwipView->SetOnSwipeListener(sleepOnSwipeListener); Add(SleepSwipView); - + return true; } @@ -78,7 +84,6 @@ namespace OHOS void SleepCardView::UnLoad(void) { - // Weather's usage scenes is complicated, so we do not release it's resources inner slice. } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardView.cpp index d4cd21c29..ad3d6e50c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardView.cpp @@ -220,21 +220,19 @@ namespace OHOS { if (!viewiInitStatus) { + // 加载组件 ,加载imagecache InitView(); viewiInitStatus = true; } - // if (!resLoadStatus) - // { - // resLoadStatus = true; - // } } void Training_CardView::UnLoad(void) { - // if (resLoadStatus) - // { - // //ImageCacheManager::GetInstance().UnloadAllInMultiRes(TRAINING_IAMGES); - // resLoadStatus = false; - // } +#if 0 + if (viewiInitStatus) + { + ImageCacheManager::GetInstance().UnloadAllInMultiRes(TRAINING_IAMGES); + } +#endif } } -- 2.17.1