From 734e255b1dcf77b6498693be6d67d50a0514c75c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Wed, 19 Jun 2024 06:14:01 +0000 Subject: [PATCH] Merge #321 into sdk602patch0521 from refs/changes/321/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/321/head: (9 commits squashed) - 解决显示方式和天气bug - 1.优化显示与亮度视图目前能够同步更新显示(除了亮屏时长视图不能考虑重构中) 2.优化ui_service, - Merge branch 'sdk602patch0521' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0521 - 修改使用ImageCacheManager后清除图片资源 - Merge branch 'sdk602patch0521' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0521 - 天气界面图片加载不用ImageCacheManager 采用直接读取路径 - Merge branch 'sdk602patch0521' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0521 - 天气视图优化修改 - Merge branch 'sdk602patch0521' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0521 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/321 --- .../nativeui/uiservice/include/ui_service.h | 7 +++-- .../nativeui/uiservice/src/ui_service.cpp | 14 +++++++-- .../weather/include/FutureWeatherView.h | 3 +- .../weather/include/WeatherControlView.h | 8 ++--- .../nativeui/weather/include/WeatherModel.h | 12 +++---- .../weather/src/FutureWeatherView.cpp | 31 ++++++++++++------- .../weather/src/GetWeatherDataErrorView.cpp | 2 +- .../nativeui/weather/src/MainWeatherView.cpp | 24 +++++++------- .../weather/src/WeatherControlView.cpp | 8 +++-- .../nativeui/weather/src/WeatherModel.cpp | 19 +++--------- .../weather/src/WeatherReportView.cpp | 11 ++++--- .../nativeui/weather/src/WeatherView.cpp | 11 ++++--- .../service/ble_service/blemoder/bletest.cpp | 2 +- ...ar-cloudy.bin => weather_clear_cloudy.bin} | 0 ...lear-sunny.bin => weather_clear_sunny.bin} | 0 ...ny-cloudy.bin => weather_sunny_cloudy.bin} | 0 16 files changed, 85 insertions(+), 67 deletions(-) rename code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/{weather_clear-cloudy.bin => weather_clear_cloudy.bin} (100%) rename code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/{weather_clear-sunny.bin => weather_clear_sunny.bin} (100%) rename code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/{weather_sunny-cloudy.bin => weather_sunny_cloudy.bin} (100%) diff --git a/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h b/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h index ac4308a52..aa90494b0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h +++ b/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-12 11:44:04 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-18 17:08:49 + * @LastEditTime: 2024-06-19 10:36:53 * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h */ /* @@ -62,7 +62,10 @@ typedef enum { UI_RM_SLEEP_VETO, UI_UPDATE_SCREEN_DURATION, //更新亮屏时长 UI_UPDATE_RAISETOBRIGHTNESS,//更新抬腕亮屏 - UI_UPDATE_BRIGHTNESS_VALUE, //更新亮度值 + UI_UPDATE_BRIGHTNESS_VALUE, //更新亮度值 + + UI_UPDATE_WEATHER_DATA, //天气数据更新 + MAX_NUM_HANDLER, } UiServiceMsgId; #define BUNDLE_NAME_LEN 128 diff --git a/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp b/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp index a8e565d9a..79402f363 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp @@ -17,6 +17,7 @@ #include #include #include "displaybrightness/include/DisplayBrightnessModel.h" +#include "weather/include/WeatherModel.h" #include "uiservice/include/ui_service.h" #include "wearable_log.h" #include "samgr_lite.h" @@ -94,6 +95,7 @@ static void HandleRemoveSleepVeto(Request *request); static void HandleUpdateScreenDuration(Request *request); static void HandleUpdateRaiseToBrightness(Request *request); static void HandleUpdateBrightnessValue(Request *request); +static void HandleUpdateWeatherData(Request *request); // 消息处理程序项数组(每个消息类型对应一个处理函数,函数名以 Handle 开头) MsgHandlerEntry msgHandlers[] = { @@ -113,6 +115,7 @@ MsgHandlerEntry msgHandlers[] = { {UI_UPDATE_SCREEN_DURATION, HandleUpdateScreenDuration}, {UI_UPDATE_RAISETOBRIGHTNESS, HandleUpdateRaiseToBrightness}, {UI_UPDATE_BRIGHTNESS_VALUE, HandleUpdateBrightnessValue}, + {UI_UPDATE_WEATHER_DATA, HandleUpdateWeatherData}, }; /* -------------------------------------------------------------------------- */ static void ScreenTurnOn(Request *request) @@ -255,8 +258,7 @@ void ServiceMsgProcess(Request *request) #endif /* -------------------------------------------------------------------------- */ WEARABLE_LOGI(WEARABLE_LOG_MODULE_UI_SERVICE, "UiServiceMsgId = %d",request->msgId); - int numHandlers = sizeof(msgHandlers) / sizeof(msgHandlers[0]); - for (int i = 0; i < numHandlers; ++i) + for (int i = 0; i < MAX_NUM_HANDLER; ++i) { if (msgHandlers[i].msgId == request->msgId) { @@ -446,6 +448,14 @@ void HandleUpdateBrightnessValue(Request *request) GraphicService::GetInstance()->PostGraphicEvent( std::bind(&OHOS::DisplayBrightnessModel::UpdateBrightnessValueOfSlider, OHOS::DisplayBrightnessModel::GetInstance())); } + +//处理更新天气数据 +static void HandleUpdateWeatherData(Request *request) +{ + WEARABLE_LOGI(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleUpdateWeatherData"); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::WeatherModel::UpdateMainWeatherData, &OHOS::WeatherModel::GetInstance())); +} /* -------------------------------------------------------------------------- */ #ifdef __cplusplus } diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h b/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h index 089b6240b..e1f0756f8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-30 09:14:38 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-15 15:19:23 + * @LastEditTime: 2024-06-19 09:54:09 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h */ #ifndef FUTURE_WEATHER_VIEW_H @@ -38,6 +38,7 @@ namespace OHOS UILabelExt *Title = nullptr; UIList *FutureWeatherList{nullptr}; FutureWeatherListAdapter *futureWeatherListAdapter{nullptr}; + bool viewInitStatus{false}; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherControlView.h b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherControlView.h index 77c4f4cd0..8ada8cdf4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherControlView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherControlView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-15 15:00:16 + * @LastEditTime: 2024-06-19 10:02:35 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherControlView.h */ #ifndef WEATHER_CONTROL_VIEW_H @@ -28,9 +28,9 @@ namespace OHOS private: void ClearAll(void); - bool InitializeWeatherScrollView(); - bool InitializeWeatherSwipeView(); - bool CreateMainWeatherView(); + bool InitializeWeatherDataErrorView(void); + bool InitializeWeatherSwipeView(void); + bool CreateMainWeatherView(void); MainWeatherView *mainWeatherView{nullptr}; UISwipeView *weatherSwipView{nullptr}; UIScrollView *weatherScrllView{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h index 8c4a5019f..669210b24 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-08 18:40:20 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-15 17:33:03 + * @LastEditTime: 2024-06-19 10:24:03 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h */ #ifndef WEATHER_MODEL_H @@ -58,8 +58,6 @@ namespace OHOS void UI_set_weather_seven_day_data(struct ONE_DAY_DATA t,int count); - void UI_UpdateMainWeatherData(void); - #if __cplusplus } #endif /* __cplusplus */ @@ -68,11 +66,11 @@ namespace OHOS #define weather_src "/user/res/weather/weather65x65/" static const char *weather65x65[] = { - weather_src "weather_placeholder.bin", // 占位或默认 + weather_src "weather_sunny.bin", // 占位或默认 weather_src "weather_sunny.bin", // 晴(白天) - weather_src "weather_clear-sunny.bin", // 晴(晚上) - weather_src "weather_sunny-cloudy.bin", // 多云(白天) - weather_src "weather_clear-cloudy.bin", // 多云(晚上) + weather_src "weather_clear_sunny.bin", // 晴(晚上) + weather_src "weather_sunny_cloudy.bin", // 多云(白天) + weather_src "weather_clear_cloudy.bin", // 多云(晚上) weather_src "weather_overcast.bin", // 阴 weather_src "weather_rain.bin", // 阵雨 weather_src "weather_thundershower.bin", // 雷雨 diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherView.cpp index ac3989f3a..09d2bc007 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherView.cpp @@ -2,13 +2,12 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-15 17:00:27 + * @LastEditTime: 2024-06-19 10:46:16 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherView.cpp */ #include "weather/include/FutureWeatherView.h" #include "wearable_log.h" #include "weather/include/WeatherModel.h" -#include "common/image_cache_manager.h" #include "language/font/ui_resource_string.h" #include "weather/include/WeatherModel.h" namespace OHOS @@ -38,16 +37,19 @@ namespace OHOS void FutureWeatherView::ClearAll() { - RemoveAll(); + if (viewInitStatus == true) + { + RemoveAll(); - delete Title; - Title = nullptr; + delete Title; + Title = nullptr; - delete futureWeatherListAdapter; - futureWeatherListAdapter = nullptr; + delete futureWeatherListAdapter; + futureWeatherListAdapter = nullptr; - delete FutureWeatherList; - FutureWeatherList = nullptr; + delete FutureWeatherList; + FutureWeatherList = nullptr; + } } bool FutureWeatherView::InitPage(void) @@ -94,18 +96,20 @@ namespace OHOS FutureWeatherList->RefreshList(); FutureWeatherList->SetIntercept(true); Add(FutureWeatherList); + viewInitStatus = true; + return true; } bool FutureWeatherView::InitView(void *caller) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FutureWeatherView::InitView %p", caller); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "FutureWeatherView::InitView %p", caller); if (InitPage() == false) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FutureWeatherView::InitPage fail"); return false; } - //UpdateFutureWeatherListData(); + // UpdateFutureWeatherListData(); SetDraggable(true); SetTouchable(true); return true; @@ -132,6 +136,11 @@ namespace OHOS futureWeatherListAdapter = nullptr; } futureWeatherListAdapter = new FutureWeatherListAdapter(); + if (futureWeatherListAdapter == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "futureWeatherListAdapter is nullptr"); + return false; + } WeatherModel::GetInstance().InitFutureWeatherItem(); FutureWeatherList->SetAdapter(futureWeatherListAdapter); FutureWeatherList->RefreshList(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp index 015e59768..4f14579f8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-15 14:22:18 + * @LastEditTime: 2024-06-19 09:52:56 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp */ #include "weather/include/GetWeatherDataErrorView.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp index a5a0e34d8..c7f874e78 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-15 16:32:55 + * @LastEditTime: 2024-06-19 10:09:11 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp */ #include "weather/include/MainWeatherView.h" @@ -13,13 +13,13 @@ namespace OHOS static MainWeatherView *g_pMainWeatherView{nullptr}; MainWeatherView::MainWeatherView() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherView::MainWeatherView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainWeatherView::MainWeatherView"); g_pMainWeatherView = this; } MainWeatherView::~MainWeatherView() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherView::~MainWeatherView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainWeatherView::~MainWeatherView"); g_pMainWeatherView = nullptr; } @@ -30,6 +30,13 @@ namespace OHOS void MainWeatherView::ClearAll(void) { + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + if (weatherSwipeViewList != nullptr) { for (int32_t i = 0; i < maxPage; i++) @@ -71,7 +78,7 @@ namespace OHOS */ UISwipeView *MainWeatherView::MainWeatherViewInit(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainWeatherView::MainWeatherViewInit"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherView::MainWeatherViewInit"); weatherSwipeViewList = new UISwipeView(UISwipeView::VERTICAL); if (nullptr == weatherSwipeViewList) { @@ -97,7 +104,7 @@ namespace OHOS recordCard[i]->InitView(this); weatherSwipeViewList->Add(recordCard[i]); } - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainWeatherView InitPage over!!"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherView InitPage over!!"); return weatherSwipeViewList; } @@ -179,12 +186,7 @@ namespace OHOS { View::OnStop(); RootView::GetInstance()->ClearOnKeyActListener(); - if (container_ != nullptr) - { - container_->RemoveAll(); - delete container_; - container_ = nullptr; - } + ClearAll(); return; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherControlView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherControlView.cpp index 66ef3d897..d2e9c941b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherControlView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherControlView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-15 15:09:37 + * @LastEditTime: 2024-06-19 10:04:22 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherControlView.cpp */ #include "weather/include/WeatherControlView.h" @@ -66,6 +66,7 @@ namespace OHOS return true; } + //天气数据有效初始化该视图 bool WeatherControlView::InitializeWeatherSwipeView() { weatherSwipView = mainWeatherView->MainWeatherViewInit(); @@ -89,7 +90,8 @@ namespace OHOS return true; } - bool WeatherControlView::InitializeWeatherScrollView() + //无天气数据则初始化该视图 + bool WeatherControlView::InitializeWeatherDataErrorView() { weatherScrllView = mainWeatherView->WeatherDataErrorViewPageInit(); if (weatherScrllView == nullptr) @@ -137,7 +139,7 @@ namespace OHOS return false; } - if (!InitializeWeatherScrollView()) + if (!InitializeWeatherDataErrorView()) { return false; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp index fe5a43b95..7002393f8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-08 18:40:09 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-18 11:21:26 + * @LastEditTime: 2024-06-19 10:24:12 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp */ #include "weather/include/WeatherModel.h" @@ -68,7 +68,6 @@ namespace OHOS */ void UI_set_weather_seven_day_data(struct ONE_DAY_DATA t, int count) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Weather_data_seven_count = %d", count); if (count == 0) { Weather_data_seven_count = 0; @@ -86,12 +85,6 @@ namespace OHOS strcpy(Weather_data_seven_data[count].textDay, t.textDay); Weather_data_seven_count++; - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Weather_data_seven_count = %d", Weather_data_seven_count); - } - - void UI_UpdateMainWeatherData(void) - { - WeatherModel::GetInstance().UpdateMainWeatherData(); } #if __cplusplus @@ -122,7 +115,6 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherView::GetInstance fail!!"); return; } - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Weather_data_seven_count = %d", Weather_data_seven_count); for (uint8_t i = 0; i < Weather_data_seven_count; i++) { FutureWeatherItem[i].iconDay = GetWeather_data_seven_data_iconDay(i); @@ -146,9 +138,8 @@ namespace OHOS // 获取天气图片 std::string WeatherModel::GetWeatherImage() { - //int index = Weather_data_t_now.iconNight;//夜晚天气图标 - int index = Weather_data_seven_data[0].iconDay;//白天天气图标 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "iconNight:%d", index); + // int index = Weather_data_t_now.iconNight;//夜晚天气图标 + int index = Weather_data_seven_data[0].iconDay; // 白天天气图标 return weather65x65[index]; } @@ -273,10 +264,10 @@ namespace OHOS return WEATHER_DATA_VALID; } - // 更新所有天气数据 + /* 更新所有天气数据 */ void WeatherModel::UpdateMainWeatherData(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UpdateMainWeatherData"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UpdateMainWeatherData"); MainWeatherView *p_MainWeatherView = MainWeatherView::GetInstance(); if (p_MainWeatherView != nullptr) diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp index 808eb32e0..a5f86d720 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp @@ -243,7 +243,7 @@ namespace OHOS bool WeatherReportView::WeatherReportViewImageAnimatorViewInit(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherReportView::WeatherReportViewImageAnimatorViewInit"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherReportView::WeatherReportViewImageAnimatorViewInit"); /* ----------------------------- UVImageAnimatorView---------------------------- */ UVPathsArray = CreateImagePathsArray(UVPaths, "bin", UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); @@ -327,31 +327,32 @@ namespace OHOS Add(UVImageAnimatorView); Add(WindSpeedImageAnimatorView); Add(HumidityImageAnimatorView); + viewInitStatus = true; + return true; } bool WeatherReportView::InitPage(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherReportView::InitPage"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherReportView::InitPage"); if (!WeatherReportViewLabelInit() || !WeatherReportViewImageAnimatorViewInit()) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherReportView::InitPage fail!!"); return false; } - viewInitStatus = true; return true; } bool WeatherReportView::InitView(void *caller) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherReportView InitView %p", caller); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherReportView InitView %p", caller); if (InitPage() == false) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherReportView::InitPage fail"); return false; } - UpdateWeatherReportViewData(); + //UpdateWeatherReportViewData(); SetDraggable(true); SetTouchable(true); return true; diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp index 3623d49c1..7e79b1afb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-12 11:44:04 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-18 20:04:39 + * @LastEditTime: 2024-06-19 10:51:02 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp */ #include "weather/include/WeatherView.h" @@ -98,7 +98,7 @@ namespace OHOS WeatherView::~WeatherView() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, " WeatherView::~WeatherView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " WeatherView::~WeatherView"); ClearAll(); g_pWeatherView = nullptr; } @@ -178,7 +178,7 @@ namespace OHOS bool WeatherView::InitPage(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " WeatherView::InitPage"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, " WeatherView::InitPage"); /* -------------------------------------------------------------------------- */ WeatherBackGroundImg = new UIImageView(); if (WeatherBackGroundImg == nullptr) @@ -277,18 +277,19 @@ namespace OHOS Add(showMaxandMinTemperatureLabel); Add(PullUpAnimatorView); viewInitStatus = true; + return true; } bool WeatherView::InitView(void *caller) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherView InitView %p", caller); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherView::InitView %p", caller); if (InitPage() == false) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherView::InitPage fail"); return false; } - UpdateWeatherViewData(); + //UpdateWeatherViewData(); SetDraggable(true); SetTouchable(true); return true; diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp index a4b4cf17c..42d46dc9b 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -947,7 +947,7 @@ void set_weather_one_data(int tempMin, int iconDay,int fxDate, int tempMax, char void ble_UpdateMainWeatherData(void) { - return OHOS::UI_UpdateMainWeatherData(); + SendMsgToUIService(UI_UPDATE_WEATHER_DATA,0,nullptr,0); } message_infor_t message_infor_s; void read_message_data(void) diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear-cloudy.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear_cloudy.bin similarity index 100% rename from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear-cloudy.bin rename to code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear_cloudy.bin diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear-sunny.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear_sunny.bin similarity index 100% rename from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear-sunny.bin rename to code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear_sunny.bin diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_sunny-cloudy.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_sunny_cloudy.bin similarity index 100% rename from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_sunny-cloudy.bin rename to code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_sunny_cloudy.bin -- 2.17.1