From f007efe8c2f8790cef1c39d6f06e5a96ba759793 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Thu, 24 Oct 2024 17:33:49 +0800 Subject: [PATCH] =?utf8?q?#904=E6=89=8B=E8=A1=A8=EF=BC=8C=E8=93=9D?= =?utf8?q?=E7=89=99=E6=9C=AA=E8=BF=9E=E6=8E=A5=E6=97=B6=EF=BC=8C=E8=AF=AD?= =?utf8?q?=E9=9F=B3=E5=8A=A9=E6=89=8B=E6=8F=90=E7=A4=BA=E8=AF=AD=E4=BD=BF?= =?utf8?q?=E7=94=A8=E9=94=99=E8=AF=AF=EF=BC=8C=E7=9B=AE=E5=89=8D=E4=BD=BF?= =?utf8?q?=E7=94=A8=E7=9A=84=E6=98=AF=E9=9F=B3=E4=B9=90=E7=9A=84=E6=8F=90?= =?utf8?q?=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../assistant/src/AssistantHfpView.cpp | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantHfpView.cpp b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantHfpView.cpp index 0973f07fe..7eb114ba6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantHfpView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantHfpView.cpp @@ -4,6 +4,7 @@ #include "string.h" #include "ui_resource_image.h" #include "ui_resource_string.h" +#include "uicomponents/UIComponents.h" #include "wearable_log.h" namespace OHOS { @@ -91,23 +92,31 @@ bool AssistantHfpView::CreateAssistantHfpViewLabel(void) { } /* -------------------------------------------------------------------------- */ - labelConfig = { - .left = 53, - .top = 230, - .width = 360, - .height = 105, - .fontSize = 30, - .lineHeigh = 35, - .textId = - STR_MUSIC_PLAYER_SOURCE_NOTE, /*请从手表端应用界面进入“音乐”-“音乐来源”,设置为“手机模式”后重试*/ - .lineBreakMode = UILabel::LINE_BREAK_WRAP, - }; - noteLabel = AssistantHfpViewLabelInit(labelConfig); - if (nullptr == noteLabel) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "noteLabel new fail!!"); - return false; - } + // labelConfig = { + // .left = 53, + // .top = 230, + // .width = 360, + // .height = 105, + // .fontSize = 30, + // .lineHeigh = 35, + // .textId = + // STR_MUSIC_PLAYER_SOURCE_NOTE, + // /*请从手表端应用界面进入“音乐”-“音乐来源”,设置为“手机模式”后重试*/ + // .lineBreakMode = UILabel::LINE_BREAK_WRAP, + // }; + // noteLabel = AssistantHfpViewLabelInit(labelConfig); + // if (nullptr == noteLabel) { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "noteLabel new fail!!"); + // return false; + // } + // TODO:多国语言 + InitLabel(noteLabel, 53, 230, 360, 105, "label", + "请连接手机后使用语音助手功能", DEFAULT_VECTOR_FONT_FILENAME_EN, + 30); + noteLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + noteLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + noteLabel->SetRollSpeed(70); /* -------------------------------------------------------------------------- */ int16_t y = noteLabel->GetY() + noteLabel->GetTextHeight() + 30 + 33; -- 2.17.1