From af5442feb5e63d22f6aeed310daf09747fc68dde Mon Sep 17 00:00:00 2001 From: xue <2144439972@qq.com> Date: Thu, 4 Dec 2025 20:01:11 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E6=94=B6=E9=9F=B3=E6=8C=87?= =?utf8?q?=E7=A4=BA=E7=81=AF=E7=9A=84=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../include/ThunderBirdDialogueView.h | 1 - .../thunderbird/include/ThunderBirdMainView.h | 1 + .../src/ThunderBirdDialogueView.cpp | 15 +------------- .../thunderbird/src/ThunderBirdMainView.cpp | 20 +++++++++++++++++++ 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdDialogueView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdDialogueView.h index 1daa8d89c..91b0371a3 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdDialogueView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdDialogueView.h @@ -146,7 +146,6 @@ namespace OHOS THUNDERBIRD_DIALOGUEVIEW_LISTENING, // 聆听中 THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW, // 状态展示 }; - UIImageView *listenIcon{nullptr}; private: UIViewGroup *group{nullptr}; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h index 1847ff3d6..969375e62 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdMainView.h @@ -113,6 +113,7 @@ namespace OHOS UIImageView *chargeBatteryicon{nullptr}; // 充电图标 bool isChargeBatteryIconVisible{false}; // 充电图标是否可见 UIImageView *earphoneIcon{nullptr}; // 耳机图标 + UIImageView *listenIcon{nullptr}; // 小绿点(聆听指示器) int16_t Batteryvalue{0}; // 电池电量 diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp index 1c4aacad4..7c60d7bf2 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp @@ -1,5 +1,6 @@ #include "thunderbird/include/ThunderBirdDialogueView.h" #include "thunderbird/include/ThunderBirdModel.h" +#include "thunderbird/include/ThunderBirdMainView.h" #include "wearable_log.h" #include #include "ln_api.h" @@ -36,7 +37,6 @@ namespace OHOS if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } if (speakAnimator != nullptr) { delete speakAnimator; speakAnimator = nullptr; } if (listenAnimator != nullptr) { delete listenAnimator; listenAnimator = nullptr; } - if (listenIcon != nullptr) { delete listenIcon; listenIcon = nullptr; } if (RemindButton != nullptr) { delete RemindButton; RemindButton = nullptr;} if (micIcon != nullptr) { delete micIcon; micIcon = nullptr;} } @@ -137,16 +137,6 @@ namespace OHOS } group->Add(speakAnimator); group->Add(listenAnimator); - listenIcon = new UIImageView(); - if (listenIcon) - { - listenIcon->SetAutoEnable(false); - listenIcon->SetPosition(162, 31, 6, 6); - listenIcon->SetSrc("/user/res/greenpoint.bin"); - listenIcon->SetVisible(false); - listenIcon->SetResizeMode(UIImageView::CONTAIN); - group->Add(listenIcon); - } RemindButton = new UILabelButton(); if (RemindButton) { @@ -180,7 +170,6 @@ namespace OHOS if (TextLabel) { TextLabel->SetVisible(false);} if (speakAnimator) { speakAnimator->SetVisible(false); speakAnimator->Stop(); } if (listenAnimator) { listenAnimator->SetVisible(false); listenAnimator->Stop(); } - if (listenIcon) { listenIcon->SetVisible(false); } switch (showView) { case THUNDERBIRD_DIALOGUEVIEW_SPEAKING: @@ -220,7 +209,6 @@ namespace OHOS //动效图标 if (listenAnimator) { listenAnimator->SetVisible(true); listenAnimator->Start(); } - if (listenIcon) { listenIcon->SetVisible(false); } // // 启动30秒超时定时器 // if (ThunderBirdModel::GetInstance()) { // ThunderBirdModel::GetInstance()->StartCountUpTimer(8); // 6秒超时 @@ -298,7 +286,6 @@ namespace OHOS // } //动效图标 if (listenAnimator) { listenAnimator->SetVisible(true); listenAnimator->Stop(); } - if (listenIcon) { listenIcon->SetVisible(true); } } } 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 f542e7192..cbc9dba9b 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 @@ -311,6 +311,11 @@ namespace OHOS delete chargeBatteryicon; chargeBatteryicon = nullptr; } + if (listenIcon != nullptr) + { + delete listenIcon; + listenIcon = nullptr; + } // 最后删除group1 delete group1; @@ -1231,6 +1236,21 @@ namespace OHOS group1->Add(chargeBatteryicon); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "chargeBatteryicon add success"); /* -------------------------------------------------------------------------- */ + /* -------------------------------- 小绿点(聆听指示器) -------------------------------- */ + listenIcon = new UIImageView(); + if (listenIcon == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "listenIcon new fail"); + return nullptr; + } + listenIcon->SetAutoEnable(false); + listenIcon->SetPosition(80, 10, 8, 8); + listenIcon->SetSrc("/user/res/greenpoint.bin"); + listenIcon->SetResizeMode(UIImageView::CONTAIN); + listenIcon->SetVisible(false); + group1->Add(listenIcon); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "listenIcon add success"); + /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ updateSignalDisplay(); /* -------------------------------------------------------------------------- */ -- 2.17.1