Merge #870 into sdk602patch0626 from refs/changes/870/head 872/target/1
author袁清梦 <3449750381@qq.com>
Wed, 4 Sep 2024 13:21:32 +0000 (13:21 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Wed, 4 Sep 2024 13:21:32 +0000 (13:21 +0000)
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 <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/870
code/sdk/application/wearable/fd230app/nativeui/set_dial_style/include/SetDialStyleView.h
code/sdk/application/wearable/fd230app/nativeui/set_dial_style/src/SetDialStyleView.cpp
code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepTimeView.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp

index ff888d7..031fe01 100644 (file)
@@ -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
 #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<SetDialStylePresenter> {
-public:
-    SetDialStyleView();
-    ~SetDialStyleView() override;
-    SetDialStyleView(const SetDialStyleView &) = delete;
-    SetDialStyleView& operator=(const SetDialStyleView &) = delete;
+namespace OHOS
+{
+    class SetDialStylePresenter;
+    class SetDialStyleView : public View<SetDialStylePresenter>
+    {
+    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<int>(DialStyle::STYLE_NUM)] = {
-        {&btnCover_, DialStyle::COVERFLOW},
-        {&btnRoller_, DialStyle::ROLLER},
+        UIImageView Cover_Image_;
+        UIImageView Roller_Image_;
+        struct
+        {
+            UIToggleButton *btn;
+            DialStyle style;
+        } styleTable_[static_cast<int>(DialStyle::STYLE_NUM)] = {
+            {&btnCover_, DialStyle::COVERFLOW},
+            {&btnRoller_, DialStyle::ROLLER},
+        };
     };
-};
 } // OHOS
 #endif
\ No newline at end of file
index 47e3bf4..580a016 100644 (file)
@@ -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<SetDialStylePresenter>::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();
index 336ad3f..dda33b9 100644 (file)
@@ -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);
index 8593777..54d3cf3 100644 (file)
@@ -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());