From: hcj <1224667075@qq.com> Date: Mon, 26 Aug 2024 06:37:25 +0000 (+0800) Subject: 电话中UI增加多国语言 X-Git-Tag: release_V1.2.70_20241020_135402~590 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=199dc6fa6c975eb718d3b484e98762e49a2bd1ed;p=mirrors%2FFD230.git 电话中UI增加多国语言 --- diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h index 02cddf143..bdb6d2da5 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/ui_resource_string.h @@ -547,12 +547,15 @@ enum UIResourceTextId : uint16_t { STR_SCHEDULE_TIME = 534, STR_SCHEDULE_NOTES = 535, STR_SCHEDULE_DELETE_PROMPT = 536, - STR_MAX_ID = 537, + STR_HANG_UP_OR_ANSWER = 537, + STR_WATCH_CALL = 538, + STR_PHONE_CALL = 539, + STR_MAX_ID = 540, }; // UIResourceTextId enum FontLanguageId : uint8_t { - LANGUAGE_ID_ZH, LANGUAGE_ID_EN, + LANGUAGE_ID_ZH, LANGUAGE_ID_MAX }; // UITextLanguageTextId } diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallerDisplayView.h b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallerDisplayView.h index bf6af48d8..957ddd094 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallerDisplayView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallerDisplayView.h @@ -35,11 +35,11 @@ private: UIImageView *imageDissgree{nullptr}; UIImageView *imageperson{nullptr}; - UILabel *callerDisplay{nullptr}; - UILabel *currentTimes{nullptr}; + UILabelExt *callerDisplay{nullptr}; + UILabelExt *currentTimes{nullptr}; - UILabel *label_call_source{nullptr}; - UILabel *label_call_hint{nullptr}; + UILabelExt *label_call_source{nullptr}; + UILabelExt *label_call_hint{nullptr}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h index 9f83efe41..378b51978 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/include/CallingView.h @@ -18,6 +18,7 @@ #include "ChangeSliceListener.h" #include "components/ui_label_button.h" + namespace OHOS { class CallingView { public: @@ -53,7 +54,7 @@ private: UIImageView *imageperson{nullptr}; UILabel *callerDisplay{nullptr}; - UILabel *currentTimes{nullptr}; + UILabelExt *currentTimes{nullptr}; UILabel *callDuration{nullptr}; UIViewGroup *dial_group{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp index 4983723e8..13f8f2379 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallerDisplayView.cpp @@ -8,6 +8,7 @@ #include "MainCallingPresenter.h" #include "UiConfig.h" #include "phoneaddressmodel.h" +#include "ui_resource_string.h" namespace OHOS { static constexpr uint16 MATH_ZERO = 0; @@ -149,7 +150,7 @@ void CallerDisplayView::updataCallingname(void) bool CallerDisplayView::InitUILabelDisplay() { - callerDisplay = new UILabel(); + callerDisplay = new UILabelExt(); if (callerDisplay == nullptr) { return false; } @@ -176,17 +177,19 @@ bool CallerDisplayView::InitUILabelDisplay() group->Add(callerDisplay); if (label_call_hint == nullptr) { - label_call_hint = new UILabel(); + label_call_hint = new UILabelExt(); } - label_call_hint->SetPosition(163, 353); // widget's left position and top position - label_call_hint->Resize(140, 35); // widget's width and height + label_call_hint->SetPosition(133, 353); // widget's left position and top position + label_call_hint->Resize(200, 35); // widget's width and height label_call_hint->SetViewId("label3");// Set style label_call_hint->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property label_call_hint->SetText("挂断/接听"); - label_call_hint->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); + label_call_hint->SetTextId(STR_HANG_UP_OR_ANSWER); + + label_call_hint->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); label_call_hint->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xff)); label_call_hint->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); label_call_hint->SetRollSpeed(0); @@ -195,7 +198,7 @@ bool CallerDisplayView::InitUILabelDisplay() if (label_call_source == nullptr) { - label_call_source = new UILabel(); + label_call_source = new UILabelExt(); } label_call_source->SetPosition(133, 34); // widget's left position and top position label_call_source->Resize(200, 60); // widget's width and height @@ -203,10 +206,17 @@ bool CallerDisplayView::InitUILabelDisplay() label_call_source->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) - label_call_source->SetText("手表来电"); + if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1) + { + label_call_source->SetText("手表来电"); + label_call_source->SetTextId(STR_WATCH_CALL); + } else - label_call_source->SetText("手机来电"); + { + label_call_source->SetText("手机来电"); + label_call_source->SetTextId(STR_PHONE_CALL); + } + label_call_source->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); label_call_source->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xff)); diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp index 55d6cb1c2..29dbd0a01 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp @@ -14,6 +14,7 @@ #include "custom_utils.h" #include "phoneaddressmodel.h" #include "bletest.h" +#include "ui_resource_string.h" namespace OHOS { static constexpr uint16 MATH_ZERO = 0; @@ -278,15 +279,15 @@ bool CallingView::InitUILabelDisplay() // group->Add(callDuration); - currentTimes = new UILabel(); + currentTimes = new UILabelExt(); if (currentTimes == nullptr) { return false; } - currentTimes->SetPosition(194, 38, - 79, 35); + currentTimes->SetPosition(184, 38, + 89, 35); currentTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); currentTimes->SetAlign(TEXT_ALIGNMENT_CENTER); - + currentTimes->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); currentTimes->SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); @@ -472,7 +473,7 @@ UIViewGroup *CallingView::CreateUIViewGroup(uint8_t type) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallingView::InitUILabelDisplay error"); return nullptr; } - currentTimes->SetText("拨号中..."); /* code */ + currentTimes->SetTextId(STR_CALLING); /* code */ if(!Initshowdial()) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingView.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingView.cpp index bac26155a..d759215a7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/MainCallingView.cpp @@ -30,6 +30,10 @@ MainCallingView::~MainCallingView() delete screenView; screenView = nullptr; + delete waitingView; + waitingView = nullptr; + + g_pMainView = nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/WaitingHintsView.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/WaitingHintsView.cpp index 87db04345..22eedc53e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/WaitingHintsView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/WaitingHintsView.cpp @@ -38,6 +38,21 @@ WaitingHintsView::WaitingHintsView() WaitingHintsView::~WaitingHintsView() { g_pMainView = nullptr; + + group->RemoveAll(); + delete imageDissgree; + imageDissgree = nullptr; + + delete callerDisplay; + callerDisplay = nullptr; + + delete newcallHints; + newcallHints = nullptr; + + + delete group; + group = nullptr; + } UIViewGroup *WaitingHintsView::CreateUIViewGroup() 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 fd9a836ee..877914900 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/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 02cddf143..bdb6d2da5 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 @@ -547,12 +547,15 @@ enum UIResourceTextId : uint16_t { STR_SCHEDULE_TIME = 534, STR_SCHEDULE_NOTES = 535, STR_SCHEDULE_DELETE_PROMPT = 536, - STR_MAX_ID = 537, + STR_HANG_UP_OR_ANSWER = 537, + STR_WATCH_CALL = 538, + STR_PHONE_CALL = 539, + STR_MAX_ID = 540, }; // UIResourceTextId enum FontLanguageId : uint8_t { - LANGUAGE_ID_ZH, LANGUAGE_ID_EN, + LANGUAGE_ID_ZH, LANGUAGE_ID_MAX }; // UITextLanguageTextId } 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 636402e86..3b168b67c 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 diff --git a/tools/language_tool/Language_xml/input_list_en.txt b/tools/language_tool/Language_xml/input_list_en.txt index ff2f09130..a21feaa16 100644 --- a/tools/language_tool/Language_xml/input_list_en.txt +++ b/tools/language_tool/Language_xml/input_list_en.txt @@ -422,7 +422,7 @@ STR_DIAL_MODE$Dial Mode STR_DIAL_VIA_WATCH_SIM$Dial via Watch SIM STR_DIAL_VIA_PHONE$Dial via Phone STR_KUMI_TECHNOLOGY$KUMI Technology -STR_CALLING$Calling +STR_CALLING$Calling... STR_NOT_PAIRED$Not Paired STR_PAIRED$Paired STR_UNPAIR$Unpair @@ -534,4 +534,7 @@ STR_TMCHBR$The maximum count has been reached STR_SCHEDULE_TOPIC$Topic: STR_SCHEDULE_TIME$Time: STR_SCHEDULE_NOTES$Notes: -STR_SCHEDULE_DELETE_PROMPT$Delete this schedule \ No newline at end of file +STR_SCHEDULE_DELETE_PROMPT$Delete this schedule +STR_HANG_UP_OR_ANSWER$HangUp/Answer +STR_WATCH_CALL$Watch Call +STR_PHONE_CALL$Phone Call \ No newline at end of file diff --git a/tools/language_tool/Language_xml/input_list_zh.txt b/tools/language_tool/Language_xml/input_list_zh.txt index 5b3854433..91cfcf5d5 100644 --- a/tools/language_tool/Language_xml/input_list_zh.txt +++ b/tools/language_tool/Language_xml/input_list_zh.txt @@ -422,7 +422,7 @@ STR_DIAL_MODE$拨号方式 STR_DIAL_VIA_WATCH_SIM$通过手表SIM卡拨号 STR_DIAL_VIA_PHONE$通过手机拨号 STR_KUMI_TECHNOLOGY$库密科技 -STR_CALLING$拨号中 +STR_CALLING$拨号中... STR_NOT_PAIRED$未配对 STR_PAIRED$已配对 STR_UNPAIR$取消配对 @@ -534,4 +534,7 @@ STR_TMCHBR$当前已达到了最高计数 STR_SCHEDULE_TOPIC$主题: STR_SCHEDULE_TIME$时间: STR_SCHEDULE_NOTES$备注: -STR_SCHEDULE_DELETE_PROMPT$是否确认删除该日程 \ No newline at end of file +STR_SCHEDULE_DELETE_PROMPT$是否确认删除该日程 +STR_HANG_UP_OR_ANSWER$挂断/接听 +STR_WATCH_CALL$手表来电 +STR_PHONE_CALL$手机来电 \ No newline at end of file diff --git a/tools/language_tool/Language_xml/language.xlsx b/tools/language_tool/Language_xml/language.xlsx index fff3495ee..6614b2bc3 100644 Binary files a/tools/language_tool/Language_xml/language.xlsx and b/tools/language_tool/Language_xml/language.xlsx differ diff --git a/tools/language_tool/Language_xml/language_en.xml b/tools/language_tool/Language_xml/language_en.xml index 5cec80150..adfc79ea5 100644 --- a/tools/language_tool/Language_xml/language_en.xml +++ b/tools/language_tool/Language_xml/language_en.xml @@ -423,7 +423,7 @@ - + @@ -536,4 +536,7 @@ + + + diff --git a/tools/language_tool/Language_xml/language_zh.xml b/tools/language_tool/Language_xml/language_zh.xml index aff2b2ae3..4271a0947 100644 --- a/tools/language_tool/Language_xml/language_zh.xml +++ b/tools/language_tool/Language_xml/language_zh.xml @@ -423,7 +423,7 @@ - + @@ -536,4 +536,7 @@ + + + diff --git a/tools/language_tool/font/en.lang b/tools/language_tool/font/en.lang index fd9a836ee..877914900 100644 Binary files a/tools/language_tool/font/en.lang and b/tools/language_tool/font/en.lang differ diff --git a/tools/language_tool/font/ui_resource_string.h b/tools/language_tool/font/ui_resource_string.h index 02cddf143..bdb6d2da5 100644 --- a/tools/language_tool/font/ui_resource_string.h +++ b/tools/language_tool/font/ui_resource_string.h @@ -547,12 +547,15 @@ enum UIResourceTextId : uint16_t { STR_SCHEDULE_TIME = 534, STR_SCHEDULE_NOTES = 535, STR_SCHEDULE_DELETE_PROMPT = 536, - STR_MAX_ID = 537, + STR_HANG_UP_OR_ANSWER = 537, + STR_WATCH_CALL = 538, + STR_PHONE_CALL = 539, + STR_MAX_ID = 540, }; // UIResourceTextId enum FontLanguageId : uint8_t { - LANGUAGE_ID_ZH, LANGUAGE_ID_EN, + LANGUAGE_ID_ZH, LANGUAGE_ID_MAX }; // UITextLanguageTextId } diff --git a/tools/language_tool/font/zh.lang b/tools/language_tool/font/zh.lang index 636402e86..3b168b67c 100644 Binary files a/tools/language_tool/font/zh.lang and b/tools/language_tool/font/zh.lang differ