From 3ad3888571fc376a78f0bbd8d715ddd5cbae88ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=A2=81=E6=B8=85=E6=A2=A6?= <3449750381@qq.com> Date: Fri, 22 Nov 2024 09:02:38 +0000 Subject: [PATCH] Merge #1449 into sdk602patch0911 from refs/changes/1449/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 袁清梦 * refs/changes/1449/head: (19 commits squashed) - 省电模式:优化提醒界面 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - 系统:增加恢复出厂删除离线日志 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - 训练:优化训练配速表心率表数据存储 - 心率:修复心率控制的错误修改 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - release V1.3.92 - autobulid.sh:屏蔽制作data.base - 运动:优化运动时长计算与显示 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 - 系统:优化部分UI适配 Signed-off-by: Caisking <3449750381@qq.com> Reviewed-by: Caisking <3449750381@qq.com> Reviewed-by: 罗正 <1732036298@qq.com> Reviewed-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Reviewed-by: aliyun6865282430 <1624952103@qq.com> Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1449 --- .../nativeui/assistant/src/AssistantAnswerView.cpp | 6 ++++-- .../nativeui/assistant/src/AssistantView.cpp | 2 +- .../nativeui/heart_blood/BloodCardView.cpp | 4 ++-- .../nativeui/heart_blood/CheckAbnormalView.cpp | 3 ++- .../nativeui/heart_blood/CheckInvalidView.cpp | 4 ++-- .../nativeui/heartrate/src/HeartNoteView.cpp | 2 +- .../nativeui/message/src/MessageLackView.cpp | 2 +- .../fd230app/nativeui/message/src/MessageView.cpp | 4 ++-- .../fd230app/nativeui/saveele/src/SaveBatView.cpp | 13 ++++++++++--- .../nativeui/sleepmode/src/SleepModeView.cpp | 14 +++++++++----- .../training_card/src/TrainingDetailView.cpp | 6 +++--- 11 files changed, 37 insertions(+), 23 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantAnswerView.cpp b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantAnswerView.cpp index 4c1006955..64844077c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantAnswerView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantAnswerView.cpp @@ -286,9 +286,11 @@ void AssistantAnswerView::InitNoteLabel() { notelabel->Resize(380, 60); notelabel->SetViewId("notelabel"); notelabel->SetStyle(STYLE_TEXT_FONT, 30); - //TODO:多国语言 + // TODO:多国语言 notelabel->SetTextId(STR_CALLSOMEONE); - notelabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); + // notelabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); + notelabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + notelabel->SetRollSpeed(70); notelabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); notelabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantView.cpp b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantView.cpp index 0eb1685a7..36798423d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/assistant/src/AssistantView.cpp @@ -87,7 +87,7 @@ void AssistantView::InitView() { AssistantScrollView[ASSISTANT_MAIN_VIEW]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); //初始化label TODO::多国语言 - InitLabelExt(noteLabel, 53, 339, 360, 35, "label",STR_WAKE_VOIVE, DEFAULT_VECTOR_FONT_FILENAME_EN, 30); + InitRollLabel(noteLabel, 53, 339, 360, 35, "label",STR_WAKE_VOIVE, DEFAULT_VECTOR_FONT_FILENAME_EN, 30); //初始化button InitButton(wakeButton, 128, 91, 210, 210, WAKE_ASSISTANT); wakeButton->SetImageSrc(WAKE_IMAGE, WAKE_IMAGE); diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.cpp index d10167b33..9b26a2dbb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/BloodCardView.cpp @@ -101,11 +101,11 @@ namespace OHOS bool BloodCardView::InitLable() { /*初始化title*/ - InitLabelExt(titleLabel, 83, 50, 300, 35, "title", STR_BLOOD, DEFAULT_VECTOR_FONT_FILENAME, 30); + InitRollLabel(titleLabel, 83, 50, 300, 35, "title", STR_BLOOD, DEFAULT_VECTOR_FONT_FILENAME, 30); /*初始化血氧值label*/ InitUILabel(bloodLabel, 83, 22, 300, 300, "bloodtext", "--", DEFAULT_VECTOR_FONT_FILENAME, 120); /*初始化检测时间*/ - InitLabelExt(timeLabel, 53, 260, 360, 35, "time", STR_CHECKNO, DEFAULT_VECTOR_FONT_FILENAME, 30); + InitRollLabel(timeLabel, 53, 260, 360, 35, "time", STR_CHECKNO, DEFAULT_VECTOR_FONT_FILENAME, 30); // 设置来回滚动属性 timeLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); timeLabel->SetRollSpeed(70); diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckAbnormalView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckAbnormalView.cpp index 9375af66b..8f4204037 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckAbnormalView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckAbnormalView.cpp @@ -74,7 +74,8 @@ namespace OHOS bool CheckAbnormalView::InitLable() { /*初始化title*/ - InitLabelExt(titleLabel, 83, 50, 300, 35, "title", STR_CHECKERROR, DEFAULT_VECTOR_FONT_FILENAME, 30); + InitRollLabel(titleLabel, 83, 50, 300, 35, "title", STR_CHECKERROR, DEFAULT_VECTOR_FONT_FILENAME, 30); + InitLabelExt(noteLabel, 53, 230, 360, 70, "time", STR_PWUWC, DEFAULT_VECTOR_FONT_FILENAME, 30); // 设置来回滚动属性 noteLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckInvalidView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckInvalidView.cpp index 51a1030d2..ff547f832 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckInvalidView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/CheckInvalidView.cpp @@ -122,8 +122,8 @@ namespace OHOS bool CheckInvalidView::InitLable() { /*初始化title*/ - InitLabelExt(titleLabel, 83, 50, 300, 35, "title", STR_CHECKEWARN, DEFAULT_VECTOR_FONT_FILENAME, 30); - InitLabelExt(remindLabel, 53, 270, 360, 70, "remindLabel", STR_HEARTNOTE, DEFAULT_VECTOR_FONT_FILENAME, 30); + InitRollLabel(titleLabel, 83, 50, 300, 35, "title", STR_CHECKEWARN, DEFAULT_VECTOR_FONT_FILENAME, 30); + InitRollLabel(remindLabel, 53, 270, 360, 70, "remindLabel", STR_HEARTNOTE, DEFAULT_VECTOR_FONT_FILENAME, 30); // 设置来回滚动属性 InitLabelExt(noteLabel, 53, 230, 360, 70, "time", STR_HEARTNOTE, DEFAULT_VECTOR_FONT_FILENAME, 30); noteLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); diff --git a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartNoteView.cpp b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartNoteView.cpp index d832a5e02..37ae1a863 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartNoteView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartNoteView.cpp @@ -79,7 +79,7 @@ UIScrollView *HeartNoteView::CreateHeartNoteView(void) { InitImageView(noteimage, 193, 120, 80, 80, "image", ICON_PATH_NOTE); /*初始化title*/ - InitLabelExt(titleLabel, 83, 50, 300, 35, "title", STR_CHECKERROR, + InitRollLabel(titleLabel, 83, 50, 300, 35, "title", STR_CHECKERROR, DEFAULT_VECTOR_FONT_FILENAME, 30); InitLabelExt(noteLabel, 53, 230, 360, 70, "time", STR_PWUWC, DEFAULT_VECTOR_FONT_FILENAME, 30); diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageLackView.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageLackView.cpp index 7edac4bd2..fe01bf486 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageLackView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageLackView.cpp @@ -64,7 +64,7 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MessageLackView::CreateUIViewGroup"); /*初始化label*/ - InitLabelExt(labelmeage, 53, 276, 360, 40, "labelMessage", STR_MESSAGENO, DEFAULT_VECTOR_FONT_FILENAME, 30); + InitRollLabel(labelmeage, 53, 276, 360, 40, "labelMessage", STR_MESSAGENO, DEFAULT_VECTOR_FONT_FILENAME, 30); labelmeage->SetTextColor(Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff)); /*初始化image*/ InitImageView(imageline, 193, 30, 365, 35, "image", lineimagePath); diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp index b03fa2f2e..f3d37b23f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp @@ -115,9 +115,9 @@ void MessageView::ShowLackView() { lackView->SetViewId("lackView"); /*初始化label*/ - InitLabelExt(labeltitle, 83, 50, 300, 35, "labletitle", + InitRollLabel(labeltitle, 83, 50, 300, 35, "labletitle", STR_MESSAGE_NOTIFICATION, DEFAULT_VECTOR_FONT_FILENAME, 30); - InitLabelExt(labelmeage, 53, 276, 360, 40, "labelMessage", STR_MESSAGENO, + InitRollLabel(labelmeage, 53, 276, 360, 40, "labelMessage", STR_MESSAGENO, DEFAULT_VECTOR_FONT_FILENAME, 30); labelmeage->SetTextColor(Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff)); /*初始化image*/ diff --git a/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp b/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp index dc3e4b5e2..c6e9a2821 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatView.cpp @@ -17,6 +17,8 @@ #include "wearable_log.h" #include "custom_runtime.h" +#include "ConfigModel.h" +#include "languagecode/LanguageInit.h" #define ANIMATION_TEST 0 extern "C" @@ -25,7 +27,8 @@ extern "C" void uapi_enter_power_saving_mode(void); } -std::string Cnweekday[] = {"周天", "周一", "周二", "周三", "周四", "周五", "周六"}; +std::string Cnweekday[] = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"}; +std::string Enweekday[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; static constexpr const char *WHITE_BATTERY = "/user/res/Battery/Battery_White.bin"; static constexpr const char *SAVE_BUTTON = "/user/res/Save_Ele/finger.bin"; @@ -437,8 +440,12 @@ namespace OHOS int minute = pTM.tm_min; int day = pTM.tm_mday; int month = pTM.tm_mon + 1; // 月份范围 [1, 12] - std::string weekStr = Cnweekday[pTM.tm_wday]; - + std::string weekStr; + if (ConfigModel::GetInstance()->GetLanguage() == ZH_CN) + weekStr = Cnweekday[pTM.tm_wday]; + else + weekStr = Enweekday[pTM.tm_wday]; + // 构建日期和时间字符串 std::string dateStr = (month < 10 ? "0" : "") + std::to_string(month) + "-" + diff --git a/code/sdk/application/wearable/fd230app/nativeui/sleepmode/src/SleepModeView.cpp b/code/sdk/application/wearable/fd230app/nativeui/sleepmode/src/SleepModeView.cpp index 987c5f215..d05e9daa8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/sleepmode/src/SleepModeView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/sleepmode/src/SleepModeView.cpp @@ -40,7 +40,9 @@ namespace OHOS // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[%d]", __LINE__); return; } - container_->SetPosition(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + + container_->SetWidth(Screen::GetInstance().GetWidth()); + container_->SetHeight(Screen::GetInstance().GetHeight()); container_->SetTouchable(true); container_->SetDraggable(true); @@ -123,8 +125,10 @@ namespace OHOS { ScrollView_ = new UIScrollView(); if (nullptr == ScrollView_) - return nullptr; - + return nullptr; + + ScrollView_->SetScrollBlankSize(35); + ScrollView_->SetReboundSize(50); ScrollView_->SetPosition(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); // ScrollView_->SetViewId(); ScrollView_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); @@ -189,7 +193,7 @@ namespace OHOS if (nullptr == CancelButton_) return nullptr; - CancelButton_->SetPosition(111, 320, 100, 100); + CancelButton_->SetPosition(111, PromptLabelExt_->GetY() + PromptLabelExt_->GetHeight() + 20, 100, 100); // CancelButton_->SetViewId(SCHEDULE_ViewId_DeleteCancelButton_); CancelButton_->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); CancelButton_->SetStyle(STYLE_BACKGROUND_OPA, 25); // 10% @@ -207,7 +211,7 @@ namespace OHOS if (nullptr == OKButton_) return nullptr; - OKButton_->SetPosition(256, 320, 100, 100); + OKButton_->SetPosition(256, PromptLabelExt_->GetY() + PromptLabelExt_->GetHeight() + 20,100, 100); OKButton_->SetViewId(SLEEPMODE_ViewId_OKButton_); OKButton_->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); OKButton_->SetStyle(STYLE_BACKGROUND_OPA, 25); // 10% diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TrainingDetailView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TrainingDetailView.cpp index 528eca306..82f4bd1cb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TrainingDetailView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TrainingDetailView.cpp @@ -52,11 +52,11 @@ bool TrainingDetailView ::InitPage() { Add(lineimage2_); // 初始化Lable - InitLabelExt(u_milelabel, 16, 234, 220, 35, "label2", STR_RANGE_SETTING, + InitRollLabel(u_milelabel, 16, 234, 220, 35, "label2", STR_RANGE_SETTING, DEFAULT_VECTOR_FONT_FILENAME, 30); - InitLabelExt(u_stepslabel, 73, 362, 320, 35, "label3", STR_STEP_NUMBER, + InitRollLabel(u_stepslabel, 73, 362, 320, 35, "label3", STR_STEP_NUMBER, DEFAULT_VECTOR_FONT_FILENAME, 30); - InitLabelExt(u_calorielabel, 225, 235, 230, 35, "label4", STR_CALORIE_SETTING, + InitRollLabel(u_calorielabel, 225, 235, 230, 35, "label4", STR_CALORIE_SETTING, DEFAULT_VECTOR_FONT_FILENAME, 30); u_milelabel->SetTextColor(Color::Gray()); u_stepslabel->SetTextColor(Color::Gray()); -- 2.17.1