From c3cb2099274661661cd4c331ab18b99671fdb82c Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Tue, 13 Jan 2026 18:33:38 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E8=93=9D=E7=89=99=E9=A1=B5?= =?utf8?q?=E9=9D=A2=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/thunderbird/src/ThunderBirdMainView.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp index 884d207f6..7056588e3 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp @@ -1127,7 +1127,7 @@ namespace OHOS void ThunderBirdMainView::ChangeView(int16_t hideView, int16_t showView, int16_t subView) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::ChangeView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::ChangeView hideView=%d, showView=%d, subView=%d", hideView, showView, subView); if (hideView > MAXVIEW) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView:: SystemViewId Overstep ones bounds"); @@ -1522,12 +1522,18 @@ namespace OHOS printf("imagePath is nullptr\n"); return; } - + + // 检查是否与当前图片路径相同,避免重复设置 + const char* currentPath = iconView->GetPath(); + if (currentPath != nullptr && strcmp(currentPath, imagePath) == 0) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::SwitchIconImage: Image already set to %s, skipping", imagePath); + return; + } WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::SwitchIconImage: Switching to image: %s", imagePath); // 清除图片缓存,确保重新加载 - CacheManager::GetInstance().Close(imagePath); + // CacheManager::GetInstance().Close(imagePath); // 设置新的图片源 iconView->SetSrc(imagePath); -- 2.17.1