天气界面图片加载不用ImageCacheManager 采用直接读取路径
authorluozheng <1732036298@qq.com>
Tue, 18 Jun 2024 12:21:37 +0000 (20:21 +0800)
committerluozheng <1732036298@qq.com>
Tue, 18 Jun 2024 12:21:37 +0000 (20:21 +0800)
code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp
code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp
code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp

index 79c898e..cc060b9 100644 (file)
@@ -580,7 +580,7 @@ namespace OHOS
      */
     void MainPresenterSample::PullUpDown_StopTimer(void)
     {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainPresenterSample::PullUpDown_StopTimer");
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainPresenterSample::PullUpDown_StopTimer");
         // 检查定时器是否存在
         if (g_timer != NULL)
         {
index 05fd5e8..97230ee 100644 (file)
@@ -171,7 +171,7 @@ namespace OHOS
 
     void PullUpDownView::ClearAll()
     {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PullUpDownView::ClearAll");
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::ClearAll");
         RemoveAll();
         if (group[DROPDOWNVIEW] != nullptr)
         {
@@ -278,7 +278,7 @@ namespace OHOS
             connectedStatusView = nullptr;
             group[CONNECTEDSTATUSVIEW] = nullptr;
         }
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PullUpDownView::ClearAll end!!");
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::ClearAll end!!");
     }
 
     /// @brief 初始化icon图标背景
index b1d1557..808eb32 100644 (file)
@@ -257,8 +257,8 @@ namespace OHOS
             }\r
             for (uint8_t i = 0; i < UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)\r
             {\r
-                UVimageAnimatorInfo[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(UVPathsArray[i]);\r
-                UVimageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO;\r
+                UVimageAnimatorInfo[i].imagePath = UVPathsArray[i];\r
+                UVimageAnimatorInfo[i].imageType = IMG_SRC_FILE_PATH;\r
                 UVimageAnimatorInfo[i].pos.x = UV_IMAGE_ANIMATOR_VIEW_X;\r
                 UVimageAnimatorInfo[i].pos.y = UV_IMAGE_ANIMATOR_VIEW_Y;\r
                 UVimageAnimatorInfo[i].width = UV_IMAGE_ANIMATOR_VIEW_W;\r
@@ -283,8 +283,8 @@ namespace OHOS
             }\r
             for (uint8_t i = 0; i < WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)\r
             {\r
-                WindSpeedimageAnimatorInfo[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(WindSpeedPathsArray[i]);\r
-                WindSpeedimageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO;\r
+                WindSpeedimageAnimatorInfo[i].imagePath = WindSpeedPathsArray[i];\r
+                WindSpeedimageAnimatorInfo[i].imageType = IMG_SRC_FILE_PATH;\r
                 WindSpeedimageAnimatorInfo[i].pos.x = WINDSPEED_IMAGE_ANIMATOR_VIEW_X;\r
                 WindSpeedimageAnimatorInfo[i].pos.y = UV_IMAGE_ANIMATOR_VIEW_Y;\r
                 WindSpeedimageAnimatorInfo[i].width = UV_IMAGE_ANIMATOR_VIEW_W;\r
@@ -309,8 +309,8 @@ namespace OHOS
             }\r
             for (uint8_t i = 0; i < HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)\r
             {\r
-                HumidityimageAnimatorInfo[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(HumidityPathsArray[i]);\r
-                HumidityimageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO;\r
+                HumidityimageAnimatorInfo[i].imagePath = HumidityPathsArray[i];\r
+                HumidityimageAnimatorInfo[i].imageType = IMG_SRC_FILE_PATH;\r
                 HumidityimageAnimatorInfo[i].pos.x = HUMIDITY_IMAGE_ANIMATOR_VIEW_X;\r
                 HumidityimageAnimatorInfo[i].pos.y = UV_IMAGE_ANIMATOR_VIEW_Y;\r
                 HumidityimageAnimatorInfo[i].width = UV_IMAGE_ANIMATOR_VIEW_W;\r
@@ -379,7 +379,6 @@ namespace OHOS
     {\r
         for (int i = 0; i < numImages; i++)\r
         {\r
-            ImageCacheManager::GetInstance().UnloadSingleRes(imagePaths[i]);\r
             delete imagePaths[i];\r
             imagePaths[i] = nullptr;\r
         }\r
index a986f1e..3623d49 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 19:35:18
+ * @LastEditTime: 2024-06-18 20:04:39
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherView.cpp
  */
 #include "weather/include/WeatherView.h"
@@ -253,8 +253,8 @@ namespace OHOS
             }
             for (uint8_t i = 0; i < PULLUP_ANIMATOR_VIEW_NUM_FRAMES; i++)
             {
-                PullUpimageAnimatorInfo[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(PullUpPathsArray[i]);
-                PullUpimageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO;
+                PullUpimageAnimatorInfo[i].imagePath = PullUpPathsArray[i];
+                PullUpimageAnimatorInfo[i].imageType = IMG_SRC_FILE_PATH;
                 PullUpimageAnimatorInfo[i].pos.x = PULLUP_ANIMATOR_VIEW_X;
                 PullUpimageAnimatorInfo[i].pos.y = PULLUP_ANIMATOR_VIEW_Y;
                 PullUpimageAnimatorInfo[i].width = PULLUP_ANIMATOR_VIEW_W;
@@ -316,7 +316,6 @@ namespace OHOS
     {
         for (int i = 0; i < numImages; i++)
         {
-            ImageCacheManager::GetInstance().UnloadSingleRes(imagePaths[i]);
             delete imagePaths[i];
             imagePaths[i] = nullptr;
         }