#904手表,蓝牙未连接时,语音助手提示语使用错误,目前使用的是音乐的提示语
authorCaisking <3449750381@qq.com>
Thu, 24 Oct 2024 09:33:49 +0000 (17:33 +0800)
committerCaisking <3449750381@qq.com>
Thu, 24 Oct 2024 09:33:49 +0000 (17:33 +0800)
code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantHfpView.cpp

index 0973f07..7eb114b 100644 (file)
@@ -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;