From 01000232ee4ccaefdc37da1e72460a1191a94547 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=A2=81=E6=B8=85=E6=A2=A6?= <3449750381@qq.com> Date: Wed, 4 Sep 2024 13:21:32 +0000 Subject: [PATCH] Merge #870 into sdk602patch0626 from refs/changes/870/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 袁清梦 * refs/changes/870/head: (3 commits squashed) - #455运动准备界面,运动名称往上移一点,所有的运动界面都这样 - #475设置-跟换表盘 开关按钮太大,全是黑色背景没有区分框 - #414手表,睡眠,作息时间,时间字体颜色需要变更为一致 Signed-off-by: Caisking <3449750381@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/870 --- .../set_dial_style/include/SetDialStyleView.h | 67 ++++++++++++------- .../set_dial_style/src/SetDialStyleView.cpp | 48 ++++++------- .../nativeui/sleep/src/SleepTimeView.cpp | 10 +-- .../nativeui/traing/src/TraingNomalView.cpp | 6 +- 4 files changed, 74 insertions(+), 57 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/include/SetDialStyleView.h b/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/include/SetDialStyleView.h index ff888d75a..031fe01f3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/include/SetDialStyleView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/include/SetDialStyleView.h @@ -1,3 +1,9 @@ +/*** + * @Date: 2024-07-05 11:09:20 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-09-04 15:06:30 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/include/SetDialStyleView.h + */ /* * Copyright (c) CompanyNameMagicTag 2024. All rights reserved. * Description: SetDialStyleView.h @@ -11,36 +17,47 @@ #include "components/ui_label.h" #include "components/ui_view_group.h" #include "components/ui_toggle_button.h" +#include "components/ui_button.h" #include "SetDialView.h" +#include "components/ui_label_ext.h" +#include "components/ui_image_view.h" #include "View.h" -namespace OHOS { -class SetDialStylePresenter; -class SetDialStyleView : public View { -public: - SetDialStyleView(); - ~SetDialStyleView() override; - SetDialStyleView(const SetDialStyleView &) = delete; - SetDialStyleView& operator=(const SetDialStyleView &) = delete; +namespace OHOS +{ + class SetDialStylePresenter; + class SetDialStyleView : public View + { + public: + SetDialStyleView(); + ~SetDialStyleView() override; + SetDialStyleView(const SetDialStyleView &) = delete; + SetDialStyleView &operator=(const SetDialStyleView &) = delete; + + void OnStart() override; + void OnSetUpView() override; + void OnStop() override; + void OnClick(UIView &view); + + private: + UILabel labelTitle_; + + UILabel labelCover_; + UILabel labelRoller_; - void OnStart() override; - void OnSetUpView() override; - void OnStop() override; - void OnClick(UIView &view); + UIToggleButton btnCover_; + UIToggleButton btnRoller_; -private: - UILabel labelTitle_; - UILabel labelCover_; - UILabel labelRoller_; - UIToggleButton btnCover_; - UIToggleButton btnRoller_; - struct { - UIToggleButton *btn; - DialStyle style; - } styleTable_[static_cast(DialStyle::STYLE_NUM)] = { - {&btnCover_, DialStyle::COVERFLOW}, - {&btnRoller_, DialStyle::ROLLER}, + UIImageView Cover_Image_; + UIImageView Roller_Image_; + struct + { + UIToggleButton *btn; + DialStyle style; + } styleTable_[static_cast(DialStyle::STYLE_NUM)] = { + {&btnCover_, DialStyle::COVERFLOW}, + {&btnRoller_, DialStyle::ROLLER}, + }; }; -}; } // OHOS #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/src/SetDialStyleView.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/src/SetDialStyleView.cpp index 47e3bf48b..580a0163d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/src/SetDialStyleView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/src/SetDialStyleView.cpp @@ -1,26 +1,9 @@ -/*** - * @Date: 2024-07-05 11:09:20 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-07-05 17:57:12 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/src/SetDialStyleView.cpp - */ -/*** - * @Date: 2024-07-05 11:09:20 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-07-05 17:47:15 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_dial_style/src/SetDialStyleView.cpp - */ -/* - * Copyright (c) CompanyNameMagicTag 2024. All rights reserved. - * Description: SetDialStyleView.cpp - * Author: - * Create: 2024-06-06 - */ + #include "SetDialStyleView.h" #include "SetDialStyleModel.h" #include "SetDialStylePresenter.h" - +#include "UiConfig.h" namespace OHOS { SetDialStyleView::SetDialStyleView() @@ -55,24 +38,41 @@ namespace OHOS return; } View::OnSetUpView(); - labelTitle_.SetPosition(178, 38, 200, 60); + + Cover_Image_.SetPosition(43, 120, 380, 100); + Cover_Image_.SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + Cover_Image_.SetStyle(STYLE_BACKGROUND_OPA, 0xff); + Cover_Image_.SetStyle(STYLE_BORDER_RADIUS, 100); + container_->Add(&Cover_Image_); + + Roller_Image_.SetPosition(43, 240, 380, 100); + Roller_Image_.SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + Roller_Image_.SetStyle(STYLE_BACKGROUND_OPA, 0xff); + Roller_Image_.SetStyle(STYLE_BORDER_RADIUS, 100); + container_->Add(&Roller_Image_); + + labelTitle_.SetPosition(83, 50, 300, 60); labelTitle_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); labelTitle_.SetText("表盘样式"); + labelTitle_.SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); // 居中 + labelTitle_.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); container_->Add(&labelTitle_); - labelCover_.SetPosition(83, 135, 200, 60); + labelCover_.SetPosition(90, 153, 200, 60); labelCover_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); labelCover_.SetText("覆盖流样式"); container_->Add(&labelCover_); - labelRoller_.SetPosition(83, 285, 200, 60); + labelRoller_.SetPosition(90, 273, 200, 60); labelRoller_.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); labelRoller_.SetText("滚筒样式"); container_->Add(&labelRoller_); - btnCover_.SetPosition(240, 75, 148, 148); + btnCover_.SetPosition(298, 145, 100, 50); + btnCover_.SetImages(PNG_TOGGLEBUTTON_ON_IMAGE, PNG_TOGGLEBUTTON_OFF_IMAGE); container_->Add(&btnCover_); - btnRoller_.SetPosition(240, 225, 148, 148); + btnRoller_.SetPosition(298, 265, 100, 50); + btnRoller_.SetImages(PNG_TOGGLEBUTTON_ON_IMAGE, PNG_TOGGLEBUTTON_OFF_IMAGE); container_->Add(&btnRoller_); const DialStyle style = SetDialStyleModel::GetInstance().GetStyle(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepTimeView.cpp b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepTimeView.cpp index 336ad3fb1..dda33b95b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepTimeView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepTimeView.cpp @@ -153,15 +153,15 @@ namespace OHOS apptitle->SetTextColor(Color::Gray()); /* ------------------------------- 数据label初始化 ------------------------------- */ restStr = "--"; - InitLabelAdapt(goal, 117, 95, 300, 50, "restlabel", restStr.c_str(), DEFAULT_VECTOR_FONT_FILENAME, 40); + InitLabel(goal, 83, 90, 300, 50, "restlabel", restStr.c_str(), DEFAULT_VECTOR_FONT_FILENAME, 40); // goal->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); goal->SetTextColor(Color::Gray()); sleepStr = "--"; - InitLabelAdapt(sleep, 79, 238, 230, 47, "sleeplabel", sleepStr.c_str(), DEFAULT_VECTOR_FONT_FILENAME, 40); - sleep->SetTextColor(Color::Purple()); + InitLabel(sleep, 10, 238, 230, 47, "sleeplabel", sleepStr.c_str(), DEFAULT_VECTOR_FONT_FILENAME, 40); + sleep->SetTextColor(Color::GetColorFromRGBA(0x53, 0x20, 0xE2, 0xff)); wakeStr = "--"; - InitLabelAdapt(wake, 319, 238, 230, 47, "wakelabel", wakeStr.c_str(), DEFAULT_VECTOR_FONT_FILENAME, 40); - wake->SetTextColor(Color::Purple()); + InitLabel(wake, 245, 238, 230, 47, "wakelabel", wakeStr.c_str(), DEFAULT_VECTOR_FONT_FILENAME, 40); + wake->SetTextColor(Color::GetColorFromRGBA(0x53, 0x20, 0xE2, 0xff)); /* -------------------------------- 将组件添加到根视图 ------------------------------- */ Add(resttitle); Add(sleeptitle); diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp index 859377788..54d3cf3e6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp @@ -47,15 +47,15 @@ namespace OHOS UIResourceTextId sport_id = TraingModel::GetInstance()->GetSportEvent(); // 初始化Lable - InitLabelExt(sporttitle_, 137, 52, 200, 80, "label1", sport_id, DEFAULT_VECTOR_FONT_FILENAME, 30); + InitLabelExt(sporttitle_, 83, 50, 300, 35, "label1", sport_id, DEFAULT_VECTOR_FONT_FILENAME, 30); container_->Add(sporttitle_); + // 初始化Button InitButton(buttonGo_, 133, 133, 200, 200, BUTTONGO); - // Set additional property buttonGo_->SetImageSrc(GO_1_IMAGE, GO_1_IMAGE); // 显示设置目标 - InitButtonExt(buttonSet_, 160, 370, 150, 50, BUTTONSET, STR_SET_GOALS, 30); + InitButtonExt(buttonSet_, 68, 370, 330, 35, BUTTONSET, STR_SET_GOALS, 30); if (TraingModel::GetInstance()->GetTagStr() != "") { buttonSet_->SetText((TraingModel::GetInstance()->GetTagStr()).c_str()); -- 2.17.1