天气视图优化修改
authorluozheng <1732036298@qq.com>
Wed, 19 Jun 2024 02:50:29 +0000 (10:50 +0800)
committerluozheng <1732036298@qq.com>
Wed, 19 Jun 2024 02:50:29 +0000 (10:50 +0800)
16 files changed:
code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h
code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp
code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h
code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherControlView.h
code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherModel.h
code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherView.cpp
code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp
code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp
code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherControlView.cpp
code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp
code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp
code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp
code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear_cloudy.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear-cloudy.bin with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear_sunny.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_clear-sunny.bin with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_sunny_cloudy.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/weather/weather65x65/weather_sunny-cloudy.bin with 100% similarity]

index ac4308a..aa90494 100644 (file)
@@ -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
index a8e565d..79402f3 100644 (file)
@@ -17,6 +17,7 @@
 #include <functional>
 #include <iostream>
 #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
 }
index 089b624..e1f0756 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com\r
  * @Date: 2024-03-30 09:14:38\r
  * @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-06-15 15:19:23\r
+ * @LastEditTime: 2024-06-19 09:54:09\r
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/include/FutureWeatherView.h\r
  */\r
 #ifndef FUTURE_WEATHER_VIEW_H\r
@@ -38,6 +38,7 @@ namespace OHOS
         UILabelExt *Title = nullptr;\r
         UIList *FutureWeatherList{nullptr};\r
         FutureWeatherListAdapter *futureWeatherListAdapter{nullptr};\r
+        bool viewInitStatus{false};\r
     };\r
 }\r
 #endif
\ No newline at end of file
index 77c4f4c..8ada8cd 100644 (file)
@@ -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};
index 8c4a501..669210b 100644 (file)
@@ -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", // 雷雨
index ac3989f..09d2bc0 100644 (file)
@@ -2,13 +2,12 @@
  * @Author: luozheng 1732036298@qq.com\r
  * @Date: 2024-01-29 15:37:44\r
  * @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-06-15 17:00:27\r
+ * @LastEditTime: 2024-06-19 10:46:16\r
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherView.cpp\r
  */\r
 #include "weather/include/FutureWeatherView.h"\r
 #include "wearable_log.h"\r
 #include "weather/include/WeatherModel.h"\r
-#include "common/image_cache_manager.h"\r
 #include "language/font/ui_resource_string.h"\r
 #include "weather/include/WeatherModel.h"\r
 namespace OHOS\r
@@ -38,16 +37,19 @@ namespace OHOS
 \r
     void FutureWeatherView::ClearAll()\r
     {\r
-        RemoveAll();\r
+        if (viewInitStatus == true)\r
+        {\r
+            RemoveAll();\r
 \r
-        delete Title;\r
-        Title = nullptr;\r
+            delete Title;\r
+            Title = nullptr;\r
 \r
-        delete futureWeatherListAdapter;\r
-        futureWeatherListAdapter = nullptr;\r
+            delete futureWeatherListAdapter;\r
+            futureWeatherListAdapter = nullptr;\r
 \r
-        delete FutureWeatherList;\r
-        FutureWeatherList = nullptr;\r
+            delete FutureWeatherList;\r
+            FutureWeatherList = nullptr;\r
+        }\r
     }\r
 \r
     bool FutureWeatherView::InitPage(void)\r
@@ -94,18 +96,20 @@ namespace OHOS
         FutureWeatherList->RefreshList();\r
         FutureWeatherList->SetIntercept(true);\r
         Add(FutureWeatherList);\r
+        viewInitStatus = true;\r
+\r
         return true;\r
     }\r
 \r
     bool FutureWeatherView::InitView(void *caller)\r
     {\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FutureWeatherView::InitView %p", caller);\r
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "FutureWeatherView::InitView %p", caller);\r
         if (InitPage() == false)\r
         {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FutureWeatherView::InitPage fail");\r
             return false;\r
         }\r
-        //UpdateFutureWeatherListData();\r
+        // UpdateFutureWeatherListData();\r
         SetDraggable(true);\r
         SetTouchable(true);\r
         return true;\r
@@ -132,6 +136,11 @@ namespace OHOS
             futureWeatherListAdapter = nullptr;\r
         }\r
         futureWeatherListAdapter = new FutureWeatherListAdapter();\r
+        if (futureWeatherListAdapter == nullptr)\r
+        {\r
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "futureWeatherListAdapter is nullptr");\r
+            return false;\r
+        }\r
         WeatherModel::GetInstance().InitFutureWeatherItem();\r
         FutureWeatherList->SetAdapter(futureWeatherListAdapter);\r
         FutureWeatherList->RefreshList();\r
index 015e597..4f14579 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com\r
  * @Date: 2024-01-29 15:37:44\r
  * @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-06-15 14:22:18\r
+ * @LastEditTime: 2024-06-19 09:52:56\r
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp\r
  */\r
 #include "weather/include/GetWeatherDataErrorView.h"\r
index a5a0e34..c7f874e 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com\r
  * @Date: 2024-01-29 15:37:44\r
  * @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-06-15 16:32:55\r
+ * @LastEditTime: 2024-06-19 10:09:11\r
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherView.cpp\r
  */\r
 #include "weather/include/MainWeatherView.h"\r
@@ -13,13 +13,13 @@ namespace OHOS
     static MainWeatherView *g_pMainWeatherView{nullptr};\r
     MainWeatherView::MainWeatherView()\r
     {\r
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherView::MainWeatherView");\r
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainWeatherView::MainWeatherView");\r
         g_pMainWeatherView = this;\r
     }\r
 \r
     MainWeatherView::~MainWeatherView()\r
     {\r
-        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherView::~MainWeatherView");\r
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainWeatherView::~MainWeatherView");\r
         g_pMainWeatherView = nullptr;\r
     }\r
 \r
@@ -30,6 +30,13 @@ namespace OHOS
 \r
     void MainWeatherView::ClearAll(void)\r
     {\r
+        if (container_ != nullptr)\r
+        {\r
+            container_->RemoveAll();\r
+            delete container_;\r
+            container_ = nullptr;\r
+        }\r
+\r
         if (weatherSwipeViewList != nullptr)\r
         {\r
             for (int32_t i = 0; i < maxPage; i++)\r
@@ -71,7 +78,7 @@ namespace OHOS
      */\r
     UISwipeView *MainWeatherView::MainWeatherViewInit(void)\r
     {\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainWeatherView::MainWeatherViewInit");\r
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherView::MainWeatherViewInit");\r
         weatherSwipeViewList = new UISwipeView(UISwipeView::VERTICAL);\r
         if (nullptr == weatherSwipeViewList)\r
         {\r
@@ -97,7 +104,7 @@ namespace OHOS
             recordCard[i]->InitView(this);\r
             weatherSwipeViewList->Add(recordCard[i]);\r
         }\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainWeatherView InitPage over!!");\r
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherView InitPage over!!");\r
         return weatherSwipeViewList;\r
     }\r
 \r
@@ -179,12 +186,7 @@ namespace OHOS
     {\r
         View<MainWeatherPresenter>::OnStop();\r
         RootView::GetInstance()->ClearOnKeyActListener();\r
-        if (container_ != nullptr)\r
-        {\r
-            container_->RemoveAll();\r
-            delete container_;\r
-            container_ = nullptr;\r
-        }\r
+\r
         ClearAll();\r
         return;\r
     }\r
index 66ef3d8..d2e9c94 100644 (file)
@@ -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;
         }
index fe5a43b..7002393 100644 (file)
@@ -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)
index 808eb32..a5f86d7 100644 (file)
@@ -243,7 +243,7 @@ namespace OHOS
 \r
     bool WeatherReportView::WeatherReportViewImageAnimatorViewInit(void)\r
     {\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherReportView::WeatherReportViewImageAnimatorViewInit");\r
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherReportView::WeatherReportViewImageAnimatorViewInit");\r
 \r
         /* ----------------------------- UVImageAnimatorView---------------------------- */\r
         UVPathsArray = CreateImagePathsArray(UVPaths, "bin", UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);\r
@@ -327,31 +327,32 @@ namespace OHOS
         Add(UVImageAnimatorView);\r
         Add(WindSpeedImageAnimatorView);\r
         Add(HumidityImageAnimatorView);\r
+        viewInitStatus = true;\r
+\r
         return true;\r
     }\r
 \r
     bool WeatherReportView::InitPage(void)\r
     {\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherReportView::InitPage");\r
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherReportView::InitPage");\r
         if (!WeatherReportViewLabelInit() || !WeatherReportViewImageAnimatorViewInit())\r
         {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherReportView::InitPage fail!!");\r
             return false;\r
         }\r
 \r
-        viewInitStatus = true;\r
         return true;\r
     }\r
 \r
     bool WeatherReportView::InitView(void *caller)\r
     {\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherReportView InitView %p", caller);\r
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherReportView InitView %p", caller);\r
         if (InitPage() == false)\r
         {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WeatherReportView::InitPage fail");\r
             return false;\r
         }\r
-        UpdateWeatherReportViewData();\r
+        //UpdateWeatherReportViewData();\r
         SetDraggable(true);\r
         SetTouchable(true);\r
         return true;\r
index 3623d49..87457c4 100644 (file)
@@ -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 09:51:05
  * @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;
index 3d36c30..8650d8d 100644 (file)
@@ -920,7 +920,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)