From: xue <2144439972@qq.com> Date: Tue, 28 Oct 2025 10:00:59 +0000 (+0800) Subject: 增加对话指示灯 X-Git-Tag: V1.0.9_20251128_194606_LN~160 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=094a95bf7826d8567586c1f78e0f60a528e44139;p=mirrors%2FFD230.git 增加对话指示灯 --- 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 332d16756..93e2210e1 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 @@ -10,15 +10,11 @@ namespace OHOS { - // static constexpr int16_t TB_SPEAK_ANIM_X = 141; - // static constexpr int16_t TB_SPEAK_ANIM_Y = 112; - // static constexpr int16_t TB_SPEAK_ANIM_W = 78; - // static constexpr int16_t TB_SPEAK_ANIM_H = 24; - static constexpr int16_t TB_SPEAK_ANIM_X = 161; + static constexpr int16_t TB_SPEAK_ANIM_X = 141; static constexpr int16_t TB_SPEAK_ANIM_Y = 112; - static constexpr int16_t TB_SPEAK_ANIM_W = 58; - static constexpr int16_t TB_SPEAK_ANIM_H = 18; - static constexpr int16_t TB_SPEAK_ANIM_FRAMES = 25; + static constexpr int16_t TB_SPEAK_ANIM_W = 78; + static constexpr int16_t TB_SPEAK_ANIM_H = 24; + static constexpr int16_t TB_SPEAK_ANIM_FRAMES = 23; static constexpr int16_t TB_SPEAK_ANIM_INTERVAL = 41; static constexpr const char *TB_SPEAK_ANIM_PATH = "/user/res/animated_icon/speak/"; @@ -54,8 +50,8 @@ namespace OHOS TB_SPEAK_IMAGE_21, TB_SPEAK_IMAGE_22, TB_SPEAK_IMAGE_23, - TB_SPEAK_IMAGE_24, - TB_SPEAK_IMAGE_25, + // TB_SPEAK_IMAGE_24, + // TB_SPEAK_IMAGE_25, }; static const char *TB_LISTEN_PATHS[TB_LISTEN_ANIM_FRAMES] = { TB_LISTEN_IMAGE_1, @@ -147,6 +143,7 @@ namespace OHOS UILabelExt *TextLabel_Y{nullptr}; UIImageAnimatorView *speakAnimator{nullptr}; UIImageAnimatorView *listenAnimator{nullptr}; + UIImageView *listenIcon{nullptr}; ImageAnimatorInfo speakImageInfo[TB_SPEAK_ANIM_FRAMES]; ImageAnimatorInfo listenImageInfo[TB_LISTEN_ANIM_FRAMES]; const char **speakPathsArray{nullptr}; 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 d7a1ddf9f..8c52b1bec 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 @@ -38,6 +38,7 @@ namespace OHOS if (speakAnimator != nullptr) { delete speakAnimator; speakAnimator = nullptr; } if (listenAnimator != nullptr) { delete listenAnimator; listenAnimator = nullptr; } + if (listenIcon != nullptr) { delete listenIcon; listenIcon = nullptr; } } bool ThunderBirdDialogueView::EnsureSpeakAnimator() { @@ -146,7 +147,16 @@ 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); + } return group; } @@ -157,7 +167,7 @@ namespace OHOS if (TextLabel_Y) { TextLabel_Y->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: @@ -206,9 +216,10 @@ namespace OHOS TextLabel_Y->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT); TextLabel_Y->SetVisible(true); } + //动效图标 if (listenAnimator) { listenAnimator->SetVisible(true); listenAnimator->Start(); } - + if (listenIcon) { listenIcon->SetVisible(true); } // 启动30秒超时定时器 if (ThunderBirdModel::GetInstance()) { ThunderBirdModel::GetInstance()->StartCountUpTimer(30); // 30秒超时