From: xue <2144439972@qq.com> Date: Tue, 28 Apr 2026 11:32:22 +0000 (+0800) Subject: 增加对话,哄睡AI生成字样 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=12cd37927b1eef632a6dcc5e1052e8578f9acef6;p=mirrors%2FFD230.git 增加对话,哄睡AI生成字样 --- 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 55847ef73..8bb129ee2 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 @@ -153,6 +153,7 @@ namespace OHOS private: UIViewGroup *group{nullptr}; UILabelExtWithShadow *TextLabel{nullptr}; + UILabelExt *AILabel{nullptr}; // AI标签(AI生成) UIImageAnimatorView *speakAnimator{nullptr}; UIImageAnimatorView *listenAnimator{nullptr}; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h index 9d021d63f..c24591f55 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdLullabyView.h @@ -49,6 +49,7 @@ namespace OHOS private: UIViewGroup *group{nullptr}; UILabelExtWithShadow *TextLabel{nullptr}; + UILabelExt *AILabel{nullptr}; // AI标签(AI生成) UILabelExt *RemindLabel{nullptr}; UIImageView *RemindIcon{nullptr}; UIImageView *RemindIcon2{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 cf2b31d94..ccdc71423 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 @@ -36,6 +36,7 @@ namespace OHOS group = nullptr; } if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; } + if (AILabel != nullptr) { delete AILabel; AILabel = nullptr; } if (speakAnimator != nullptr) { delete speakAnimator; speakAnimator = nullptr; } if (listenAnimator != nullptr) { delete listenAnimator; listenAnimator = nullptr; } if (RemindButton != nullptr) { delete RemindButton; RemindButton = nullptr;} @@ -128,6 +129,14 @@ namespace OHOS TextLabel->SetVisible(false); group->Add(TextLabel); } + AILabel = new UILabelExt(); + if (AILabel) { + AILabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + AILabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 14); + AILabel->SetText("AI生成"); + AILabel->SetStyle(STYLE_BACKGROUND_OPA, 0); + AILabel->SetVisible(false); + } if(!EnsureSpeakAnimator()) { return nullptr; @@ -162,6 +171,9 @@ namespace OHOS micIcon->SetVisible(false); group->Add(micIcon); } + if (AILabel != nullptr) { + group->Add(AILabel); + } return group; } @@ -181,6 +193,7 @@ namespace OHOS { if (group == nullptr) { return; } if (TextLabel) { TextLabel->SetVisible(false);} + if (AILabel) { AILabel->SetVisible(false);} if (speakAnimator) { speakAnimator->SetVisible(false); speakAnimator->Stop(); } if (listenAnimator) { listenAnimator->SetVisible(false); listenAnimator->Stop(); } switch (showView) @@ -193,6 +206,15 @@ namespace OHOS TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); TextLabel->SetVisible(true); } + if (AILabel) + { + AILabel->SetPosition(18, -7, 325, 42); + AILabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 14); + AILabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + AILabel->SetText("AI生成"); + AILabel->SetStyle(STYLE_BACKGROUND_OPA, 0x40); + AILabel->SetVisible(true); + } if(ThunderBirdModel::GetInstance()->IsTextEmpty() == true) { diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp index 80070bdfc..8d66008aa 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdLullabyView.cpp @@ -104,6 +104,10 @@ namespace OHOS delete TextLabel; TextLabel = nullptr; } + if (AILabel != nullptr) { + delete AILabel; + AILabel = nullptr; + } if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; @@ -181,7 +185,15 @@ namespace OHOS TextLabel->SetVisible(false); group->Add(TextLabel); } - + AILabel = new UILabelExt(); + if (AILabel) { + AILabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + AILabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 14); + AILabel->SetText("AI生成"); + AILabel->SetStyle(STYLE_BACKGROUND_OPA, 0); + AILabel->SetVisible(false); + } + RemindLabel = new UILabelExt(); if (RemindLabel) { @@ -211,6 +223,10 @@ namespace OHOS return nullptr; } group->Add(listenAnimator); + /* AILabel 叠在动画之上,保证顶部条可见 */ + if (AILabel != nullptr) { + group->Add(AILabel); + } return group; } @@ -228,6 +244,7 @@ namespace OHOS TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); TextLabel->SetShadowOffsetX(0); TextLabel->SetShadowOffsetY(0); } + if (AILabel) { AILabel->SetVisible(false);} if (RemindLabel) { RemindLabel->SetVisible(false);} if (RemindIcon) { RemindIcon->SetVisible(false); } if (RemindIcon2) { RemindIcon2->SetVisible(false); } @@ -396,6 +413,15 @@ namespace OHOS } //取消常亮屏 ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON); + if (AILabel) + { + AILabel->SetPosition(18, -7, 325, 42); + AILabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 14); + AILabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + AILabel->SetText("AI生成"); + AILabel->SetStyle(STYLE_BACKGROUND_OPA, 0x40); + AILabel->SetVisible(true); + } // ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); if (TextLabel) {