From: luozheng <1732036298@qq.com> Date: Tue, 23 Apr 2024 11:31:43 +0000 (+0800) Subject: 修改设置视图以适配多国语言 X-Git-Tag: release_V1.2.70_20241020_135402~1025^2~76 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F3;p=mirrors%2FFD230.git 修改设置视图以适配多国语言 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h index fe4c0a055..27b85ae82 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-30 09:14:38 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-02 20:04:15 + * @LastEditTime: 2024-04-23 19:24:51 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h */ /* @@ -19,6 +19,7 @@ #include "UiConfig.h" #include "SettingModel.h" #include "components/ui_label_button_ext.h" +#include "components/ui_label_ext.h" #include "components/ui_image_view.h" namespace OHOS { @@ -34,6 +35,7 @@ namespace OHOS private: SettingItemView(const SettingItemView &); UIImageView Icon; + UILabelExt settingLabelExt; UILabelButtonExt settingLabelButtonExt; SettingItem sItemInfo = {SETTING_ITEM_ZERO, nullptr, STR_EXERCISE_GENERAL, false}; }; diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp index 4a3b85082..bf2836d41 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-27 19:48:49 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-03 14:11:23 + * @LastEditTime: 2024-04-23 19:26:32 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp */ @@ -32,12 +32,14 @@ namespace OHOS SetTouchable(true); SetUpChild(); Add(&settingLabelButtonExt); + Add(&settingLabelExt); Add(&Icon); } SettingItemView::~SettingItemView() { Remove(&settingLabelButtonExt); + Remove(&settingLabelExt); Remove(&Icon); } @@ -46,7 +48,7 @@ namespace OHOS sItemInfo = itemInfo; Icon.SetSrc(itemInfo.icon); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%d", itemInfo.textId); - settingLabelButtonExt.SetTextId(itemInfo.textId); + settingLabelExt.SetTextId(itemInfo.textId); } void SettingItemView::SetUpChild() @@ -54,6 +56,13 @@ namespace OHOS Icon.SetPosition(SETTING_ICON_X, SETTING_SICON_Y); Icon.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); + settingLabelExt.SetPosition(115, 33,180,100); + settingLabelExt.SetStyle(STYLE_TEXT_FONT, 30); + settingLabelExt.SetStyle(STYLE_LINE_HEIGHT, 35); + settingLabelExt.SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + settingLabelExt.SetRollSpeed(40); + settingLabelExt.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + settingLabelButtonExt.SetPosition(0, 0, 380, 100); settingLabelButtonExt.SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); settingLabelButtonExt.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);