From: luozheng <1732036298@qq.com> Date: Mon, 6 May 2024 09:57:39 +0000 (+0800) Subject: 修改运动识别Slice并适配多国语言 X-Git-Tag: release_V1.2.70_20241020_135402~1113^2~21 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=8dc65d64ef83163cf64670dd4af0518ea0af59a4;p=mirrors%2FFD230.git 修改运动识别Slice并适配多国语言 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt index 27331c392..c4042f1f6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt @@ -297,4 +297,8 @@ STR_SYSTEM_VOLUME$System Volume STR_MEDIA_VOLUME$Media Volume STR_VIBRATION_MODE$Vibration Mode STR_SILENT_MODE$Silent Mode +STR_LIST_DISPLAY$List display +STR_GRID_DISPLAY$Grid Display +STR_CELLULAR_DISPLAY$Cellular Display +STR_AUTO_DETECT$Auto Detect STR_LANGUAGE$Language \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt index fee9516de..6e435c7c5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt @@ -297,4 +297,8 @@ STR_SYSTEM_VOLUME$系统音量 STR_MEDIA_VOLUME$媒体音量 STR_VIBRATION_MODE$震动模式 STR_SILENT_MODE$静音模式 +STR_LIST_DISPLAY$列表显示 +STR_GRID_DISPLAY$网格显示 +STR_CELLULAR_DISPLAY$蜂窝显示 +STR_AUTO_DETECT$自动识别 STR_LANGUAGE$语言 \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml index a2dffb09c..bdddb5422 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml @@ -298,5 +298,9 @@ + + + + diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml index a99f7d62d..6597a5a85 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml @@ -298,5 +298,9 @@ + + + + diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang index 0969d9af6..75b51af23 100644 Binary files a/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang and b/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang differ diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang index 4a063d757..00b01737d 100644 Binary files a/code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang and b/code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang differ diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h b/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h index 7968d6a35..e26afe878 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h +++ b/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h @@ -310,8 +310,12 @@ enum UIResourceTextId : uint16_t { STR_MEDIA_VOLUME = 297, STR_VIBRATION_MODE = 298, STR_SILENT_MODE = 299, - STR_LANGUAGE = 300, - STR_MAX_ID = 301, + STR_LIST_DISPLAY = 300, + STR_GRID_DISPLAY = 301, + STR_CELLULAR_DISPLAY = 302, + STR_AUTO_DETECT = 303, + STR_LANGUAGE = 304, + STR_MAX_ID = 305, }; // UIResourceTextId enum FontLanguageId : uint8_t { diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang index 10bbbaa29..3ba13c590 100644 Binary files a/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang and b/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang differ diff --git a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h index 28e9bf1ad..de1ee9181 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-23 17:29:18 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-23 18:03:26 + * @LastEditTime: 2024-05-06 17:48:35 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h */ #ifndef MOTION_RECOGNITION_VIEW_H @@ -35,9 +35,9 @@ namespace OHOS void MotionRecognitionViewInit(void); void ClearAll(void); UIScrollView *scrollView = nullptr; - UILabel *Title = nullptr; + UILabelExt *Title = nullptr; UIImageView *MotionRecognitionImage = nullptr; - UILabel *MotionRecognitionLabel = nullptr; + UILabelExt *MotionRecognitionLabel = nullptr; UIToggleButton *MotionRecognitionToggleButton = nullptr; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp index 46d56c4d8..1aa165a4d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-04-23 17:28:52 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-24 14:26:44 + * @LastEditTime: 2024-05-06 17:52:26 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp */ #include "motionrecognition/include/MotionRecognitionPresenter.h" @@ -85,17 +85,20 @@ namespace OHOS } scrollView->SetOnDragListener(draglistener); /* -------------------------------------------------------------------------- */ + Title = new UILabelExt(); if (Title == nullptr) { - Title = new UILabel(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognitionView::Title can not be nullptr!"); + return; } Title->SetPosition(83, 50, 300, 40); Title->SetStyle(STYLE_TEXT_FONT, 30); Title->SetStyle(STYLE_LINE_HEIGHT, 35); - Title->SetText("运动识别"); + //Title->SetText("运动识别"); + Title->SetTextId(STR_MOTION_RECOGNITION); Title->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - Title->SetRollSpeed(40); + //Title->SetRollSpeed(40); Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); Title->SetVisible(true); /* -------------------------------------------------------------------------- */ @@ -108,16 +111,19 @@ namespace OHOS MotionRecognitionImage->SetStyle(STYLE_BACKGROUND_OPA, 0xff); MotionRecognitionImage->SetStyle(STYLE_BORDER_RADIUS, 100); /* -------------------------------------------------------------------------- */ + MotionRecognitionLabel = new UILabelExt(); if (MotionRecognitionLabel == nullptr) { - MotionRecognitionLabel = new UILabel(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognitionView::MotionRecognitionLabel can not be nullptr!"); + return; } MotionRecognitionLabel->SetPosition(90, 153, 180, 40); MotionRecognitionLabel->SetStyle(STYLE_TEXT_FONT, 30); MotionRecognitionLabel->SetStyle(STYLE_LINE_HEIGHT, 35); - MotionRecognitionLabel->SetText("自动识别"); + //MotionRecognitionLabel->SetText("自动识别"); + MotionRecognitionLabel->SetTextId(STR_AUTO_DETECT); MotionRecognitionLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); - MotionRecognitionLabel->SetRollSpeed(40); + //MotionRecognitionLabel->SetRollSpeed(40); MotionRecognitionLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); /* -------------------------------------------------------------------------- */ MotionRecognitionToggleButton = new UIToggleButton(); diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang index 0969d9af6..75b51af23 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ja.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ja.lang index 4a063d757..00b01737d 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ja.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ja.lang differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h index 7968d6a35..e26afe878 100644 --- a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h @@ -310,8 +310,12 @@ enum UIResourceTextId : uint16_t { STR_MEDIA_VOLUME = 297, STR_VIBRATION_MODE = 298, STR_SILENT_MODE = 299, - STR_LANGUAGE = 300, - STR_MAX_ID = 301, + STR_LIST_DISPLAY = 300, + STR_GRID_DISPLAY = 301, + STR_CELLULAR_DISPLAY = 302, + STR_AUTO_DETECT = 303, + STR_LANGUAGE = 304, + STR_MAX_ID = 305, }; // UIResourceTextId enum FontLanguageId : uint8_t { diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang index 10bbbaa29..3ba13c590 100644 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang differ