修改运动识别Slice并适配多国语言
authorluozheng <1732036298@qq.com>
Mon, 6 May 2024 09:57:39 +0000 (17:57 +0800)
committerluozheng <1732036298@qq.com>
Mon, 6 May 2024 09:57:39 +0000 (17:57 +0800)
14 files changed:
code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt
code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt
code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml
code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml
code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang
code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang
code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h
code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang
code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h
code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ja.lang
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang

index 27331c3..c4042f1 100644 (file)
@@ -297,4 +297,8 @@ STR_SYSTEM_VOLUME$System Volume
 STR_MEDIA_VOLUME$Media Volume\r
 STR_VIBRATION_MODE$Vibration Mode\r
 STR_SILENT_MODE$Silent Mode\r
+STR_LIST_DISPLAY$List display\r
+STR_GRID_DISPLAY$Grid Display\r
+STR_CELLULAR_DISPLAY$Cellular Display\r
+STR_AUTO_DETECT$Auto Detect\r
 STR_LANGUAGE$Language 
\ No newline at end of file
index fee9516..6e435c7 100644 (file)
@@ -297,4 +297,8 @@ STR_SYSTEM_VOLUME$系统音量
 STR_MEDIA_VOLUME$媒体音量\r
 STR_VIBRATION_MODE$震动模式\r
 STR_SILENT_MODE$静音模式\r
+STR_LIST_DISPLAY$列表显示\r
+STR_GRID_DISPLAY$网格显示\r
+STR_CELLULAR_DISPLAY$蜂窝显示\r
+STR_AUTO_DETECT$自动识别\r
 STR_LANGUAGE$语言
\ No newline at end of file
index a2dffb0..bdddb54 100644 (file)
        <lanstr id="STR_MEDIA_VOLUME" value="Media Volume"/>
        <lanstr id="STR_VIBRATION_MODE" value="Vibration Mode"/>
        <lanstr id="STR_SILENT_MODE" value="Silent Mode"/>
+       <lanstr id="STR_LIST_DISPLAY" value="List display"/>
+       <lanstr id="STR_GRID_DISPLAY" value="Grid Display"/>
+       <lanstr id="STR_CELLULAR_DISPLAY" value="Cellular Display"/>
+       <lanstr id="STR_AUTO_DETECT" value="Auto Detect"/>
        <lanstr id="STR_LANGUAGE" value="Language"/>
 </language>
index a99f7d6..6597a5a 100644 (file)
        <lanstr id="STR_MEDIA_VOLUME" value="媒体音量"/>
        <lanstr id="STR_VIBRATION_MODE" value="震动模式"/>
        <lanstr id="STR_SILENT_MODE" value="静音模式"/>
+       <lanstr id="STR_LIST_DISPLAY" value="列表显示"/>
+       <lanstr id="STR_GRID_DISPLAY" value="网格显示"/>
+       <lanstr id="STR_CELLULAR_DISPLAY" value="蜂窝显示"/>
+       <lanstr id="STR_AUTO_DETECT" value="自动识别"/>
        <lanstr id="STR_LANGUAGE" value="语言"/>
 </language>
index 0969d9a..75b51af 100644 (file)
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
index 4a063d7..00b0173 100644 (file)
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
index 7968d6a..e26afe8 100644 (file)
@@ -310,8 +310,12 @@ enum UIResourceTextId : uint16_t {
     STR_MEDIA_VOLUME = 297,\r
     STR_VIBRATION_MODE = 298,\r
     STR_SILENT_MODE = 299,\r
-    STR_LANGUAGE = 300,\r
-    STR_MAX_ID = 301,\r
+    STR_LIST_DISPLAY = 300,\r
+    STR_GRID_DISPLAY = 301,\r
+    STR_CELLULAR_DISPLAY = 302,\r
+    STR_AUTO_DETECT = 303,\r
+    STR_LANGUAGE = 304,\r
+    STR_MAX_ID = 305,\r
 }; // UIResourceTextId\r
 
 enum FontLanguageId : uint8_t {
index 10bbbaa..3ba13c5 100644 (file)
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
index 28e9bf1..de1ee91 100644 (file)
@@ -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;
     };
 }
index 46d56c4..1aa165a 100644 (file)
@@ -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();
index 0969d9a..75b51af 100644 (file)
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
index 4a063d7..00b0173 100644 (file)
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
index 7968d6a..e26afe8 100644 (file)
@@ -310,8 +310,12 @@ enum UIResourceTextId : uint16_t {
     STR_MEDIA_VOLUME = 297,\r
     STR_VIBRATION_MODE = 298,\r
     STR_SILENT_MODE = 299,\r
-    STR_LANGUAGE = 300,\r
-    STR_MAX_ID = 301,\r
+    STR_LIST_DISPLAY = 300,\r
+    STR_GRID_DISPLAY = 301,\r
+    STR_CELLULAR_DISPLAY = 302,\r
+    STR_AUTO_DETECT = 303,\r
+    STR_LANGUAGE = 304,\r
+    STR_MAX_ID = 305,\r
 }; // UIResourceTextId\r
 
 enum FontLanguageId : uint8_t {
index 10bbbaa..3ba13c5 100644 (file)
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