From 311021f7b9d57ee5ab726ccd75d939b56cf71e2c Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Mon, 8 Dec 2025 20:29:48 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8DotaBUG=EF=BC=88=E8=A1=A5?= =?utf8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeapp/nativeui/ota/src/OtaModel.cpp | 22 ++++--------------- .../nativeui/ota/src/OtaSuccessView.cpp | 18 +++++++++++++++ .../ln/nativeapp/nativeui/ota/src/OtaView.cpp | 13 +---------- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp index eb63180cf..4ad9f988c 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaModel.cpp @@ -17,7 +17,6 @@ #include "system/include/MemoryManager.h" #include "thunderbird/include/ThunderBirdModel.h" #include "NativeAbility.h" -#include "ln_api_interface.h" #ifdef SUPPORT_CAT1_SERVICE #include "cat1_pub_api.h" #endif @@ -477,30 +476,15 @@ namespace OHOS void OtaModel::HandleDownloadSuccess(int type) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OtaModel::HandleDownloadSuccess type=%d", type); - - // 判断是表情下载还是屏保下载 - if(type == DOWNLOAD_FILE_TYPE_EMOJI || type == DOWNLOAD_FILE_TYPE_SCREEN_IMAGE) - { - // 表情下载或屏保下载完成,跳转回主界面 - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OtaModel::HandleDownloadSuccess: 表情/屏保下载完成,跳转回主界面"); - uapi_setScreenDuration(30000); // 重新设置30秒自动息屏 - - // 清空下载文件类型 - ThunderBirdModel::GetInstance()->ClearDownloadFile(); - - // 跳转回主界面 - NativeAbility::GetInstance().SwitchSlice(VIEW_THUNDER_BIRD); - } - else - { // OTA升级下载完成,跳转到OTA升级成功界面 if(OtaDownloadView::GetInstance()) { uapi_setScreenDuration(30000); // 重新设置30秒自动息屏 OtaView::GetInstance()->ChangeView(OtaView::OTA_VIEW_DOWNLOAD, OtaView::OTA_VIEW_UPDATE_SUCCESS); OtaSuccessView::GetInstance()->UpdateDownloadSuccess("下载成功"); + // 清空下载文件类型 + ThunderBirdModel::GetInstance()->ClearDownloadFile(); } - } } //下载进度通知 @@ -540,6 +524,8 @@ namespace OHOS uapi_setScreenDuration(30000); // 重新设置30秒自动息屏 OtaView::GetInstance()->ChangeView(OtaView::OTA_VIEW_DOWNLOAD, OtaView::OTA_VIEW_UPDATE_SUCCESS); OtaSuccessView::GetInstance()->UpdateDownloadSuccess("下载失败"); + // 清空下载文件类型 + ThunderBirdModel::GetInstance()->ClearDownloadFile(); } } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaSuccessView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaSuccessView.cpp index e14e505bb..79800e937 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaSuccessView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaSuccessView.cpp @@ -81,6 +81,16 @@ namespace OHOS RemindLabel->SetVisible(true); group->Add(RemindLabel); } + RemindIcon = new UIImageView(); + if (RemindIcon) + { + RemindIcon->SetAutoEnable(false); + RemindIcon->SetPosition(159, 276, 22, 22); + RemindIcon->SetResizeMode(UIImageView::CONTAIN); + RemindIcon->SetSrc("/user/res/volume_up.bin"); + RemindIcon->SetVisible(false); + group->Add(RemindIcon); + } RemindIcon1 = new UIImageView(); if (RemindIcon1) { @@ -106,6 +116,7 @@ namespace OHOS if (TextLabel) { delete TextLabel; TextLabel = nullptr; } if (LittleTextLabel) { delete LittleTextLabel; LittleTextLabel = nullptr; } if (RemindLabel) { delete RemindLabel; RemindLabel = nullptr; } + if (RemindIcon) { delete RemindIcon; RemindIcon = nullptr; } if (RemindIcon1) { delete RemindIcon1; RemindIcon1 = nullptr; } } @@ -126,8 +137,15 @@ namespace OHOS RemindIcon1->Invalidate(); return; } + TextLabel->SetText(content.c_str()); LittleTextLabel->SetVisible(false); + RemindIcon->SetVisible(true); + if (RemindLabel) { + RemindLabel->SetPosition(136, 275, 88, 25); + RemindLabel->SetText("按 确认"); + RemindLabel->SetVisible(true); + } TextLabel->Invalidate(); } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaView.cpp index b82ff948e..f53e3a93e 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/ota/src/OtaView.cpp @@ -123,7 +123,7 @@ namespace OHOS // 添加状态栏(如果ThunderBirdMainView存在则复用,否则创建独立的状态栏) - ScrollView_->Add(CreateIndependentStatusBar()); // 创建独立的状态栏 + // ScrollView_->Add(CreateIndependentStatusBar()); // 创建独立的状态栏 // 启动状态栏更新定时器 // 暂时关闭刷新时间和信号的定时器 @@ -395,17 +395,6 @@ namespace OHOS } group[hideView]->SetVisible(false); } - else - { - // 当hideView == MAX_OTA_VIEW时,隐藏所有其他已创建的视图,避免显示混乱 - for (int i = 0; i < MAX_OTA_VIEW; i++) - { - if (group[i] != nullptr && i != showView) - { - group[i]->SetVisible(false); - } - } - } ClickFunc(showView); group[showView]->SetStyle(STYLE_BACKGROUND_OPA, 0x00); group[showView]->SetVisible(true); -- 2.17.1