From 7d5a35a6c985fe431647b39c00ea608170c37d7e Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Fri, 5 Dec 2025 15:44:40 +0800 Subject: [PATCH] =?utf8?q?272:=E6=B7=BB=E5=8A=A0=E7=9B=91=E7=AE=A1?= =?utf8?q?=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../system/include/SystemAboutTheWatchView.h | 4 + .../include/SystemSuperVisionInfoView.h | 58 +++ .../nativeui/system/include/SystemView.h | 4 + .../system/src/SystemAboutTheWatchView.cpp | 44 ++ .../nativeui/system/src/SystemPresenter.cpp | 10 + .../system/src/SystemSuperVisionInfoView.cpp | 420 ++++++++++++++++++ .../nativeui/system/src/SystemView.cpp | 24 + .../watchQRcode/src/WatchQRCodeView.cpp | 8 +- .../config/target_config/brandy/config.py | 1 + 9 files changed, 569 insertions(+), 4 deletions(-) create mode 100644 code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemSuperVisionInfoView.h create mode 100644 code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemSuperVisionInfoView.cpp diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemAboutTheWatchView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemAboutTheWatchView.h index 1f943bdb5..7d49b319d 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemAboutTheWatchView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemAboutTheWatchView.h @@ -14,10 +14,12 @@ #include "components/ui_label.h" #include "components/ui_label_ext.h" #include "components/ui_image_view.h" +#include "components/ui_label_button_ext.h" #include namespace OHOS { static constexpr const char *SYSTEMABOUTTHEWATCHVIEWID = "SystemAboutTheWatchView"; // 关于手表 + static constexpr const char *VIEW_ID_SUPERVISIONINFO_TITLE_BUTTON = "VIEW_ID_SUPERVISIONINFO_TITLE_BUTTON"; // 监管信息标题按钮 class SystemAboutTheWatchView { @@ -68,6 +70,8 @@ namespace OHOS UILabel *CyweeVersion = nullptr; UILabel *APNprotocolTitle = nullptr; //APN协议 UILabel * APNprotocol = nullptr; + UILabel *SupervisionInfoTitle{nullptr}; //监管信息Title + UILabelButton *SupervisionInfoTitleButton{nullptr};//监管信息Title按钮 bool initViewStatus{false}; }; } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemSuperVisionInfoView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemSuperVisionInfoView.h new file mode 100644 index 000000000..d4d16f596 --- /dev/null +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemSuperVisionInfoView.h @@ -0,0 +1,58 @@ +#ifndef SYSTEMSUPERVISIONINFOVIEW_H +#define SYSTEMSUPERVISIONINFOVIEW_H + +#include "components/ui_label_ext.h" +#include "components/ui_button.h" +#include "components/ui_image_view.h" +#include "components/ui_scroll_view.h" + +namespace OHOS +{ + static constexpr const char *SYSTEMSUPERVISIONINFOVIEWID = "SystemSuperVisionInfoView"; // 监管信息 + class SystemSuperVisionInfoView + { + public: + SystemSuperVisionInfoView(); + ~SystemSuperVisionInfoView(); + + UIScrollView *SystemSuperVisionInfoViewInit(void); + struct LabelConfig + { + int16_t left; + int16_t top; + int16_t width; + int16_t height; + int16_t fontSize; // 字体大小 + int16_t lineHeigh; // 行高 + std::string text; // 文本 + uint16_t textId; + uint8_t lineBreakMode; // 断行模式。 + }; + + private: + void ClearAll(void); + UILabelExt *InitLabel_Ext(LabelConfig &labelConfig); + UILabel *InitLabel(LabelConfig &labelConfig); + UIScrollView *SystemSuperVisionInfoScrollView{nullptr}; + UILabel *title{nullptr}; + //型号 + UILabel *watchModelTitle{nullptr}; + UILabel *watchModel{nullptr}; + //输入信息 + UILabel *inputInfoTitle{nullptr}; + UILabel *inputInfo1{nullptr}; + UILabel *inputInfo2{nullptr}; + //产品名称 + UILabel *productNameTitle{nullptr}; + UILabel *productName{nullptr}; + //CMIT ID + UILabel *cmitTitle{nullptr}; + UILabel *cmit{nullptr}; + //公司名称 + UILabel *companyNameTitle{nullptr}; + UILabel *companyName{nullptr}; + }; + +} + +#endif // SYSTEMSUPERVISIONINFOVIEW_H \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemView.h index 93a73cae8..d6eb50d8d 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/include/SystemView.h @@ -25,6 +25,7 @@ #include "system/include/SystemShutdown.h" #include "system/include/SystemRestart.h" #include "rebootandshutdown/include/ShutDownImageAnimatorView.h" +#include "system/include/SystemSuperVisionInfoView.h" namespace OHOS { static constexpr const char *ABOUT_THE_WATCH = "AboutTheWatchButton"; // 关于手表 @@ -45,6 +46,7 @@ namespace OHOS SHUTDOWNVIEW, // 关机视图(subView) FACTORYRESETVIEW, // 恢复出厂设置视图(subView) SHUTDOWNANIMATIONVIEW, // 关机动画(subView) + SUPERVISIONINFOVIEW, // 监管信息视图(subView) MAX_SYSTEMVIEWID, } SYSTEMVIEWID; @@ -87,6 +89,7 @@ namespace OHOS bool ChangeToSystemRestartView(int16_t thisView); bool ChangeToSystemShutdownView(int16_t thisView); bool ChangeToSystemShutdownAnimatorView(int16_t thisView); + bool ChangeToSystemSuperVisionInfoView(int16_t thisView); bool ClickFunc(int16_t interface); bool CheckViewParam(int16_t hideView, int16_t showView); void ChangeView(int16_t hideView, int16_t showView); @@ -98,6 +101,7 @@ namespace OHOS SystemRestart *p_SystemRestart{nullptr}; // 重启 SystemShutdown *p_SystemShutdown{nullptr}; // 关机 ShutDownImageAnimatorView *p_ShutDownImageAnimatorView{nullptr}; // 关机动画 + SystemSuperVisionInfoView *p_SystemSuperVisionInfoView{nullptr}; // 监管信息视图 private: UILabelButtonExt *SystemViewLabelButtonInit(ButtonConfig &buttonconfig); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemAboutTheWatchView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemAboutTheWatchView.cpp index 305c756fa..81bd2d14c 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemAboutTheWatchView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemAboutTheWatchView.cpp @@ -30,6 +30,7 @@ #define WATCH_FONT_VALUE_TOP (WATCH_FONT_TOP + WATCH_ABOUT_TITLE_HEIGHT) #define WATCH_CYWEEVER_TOP (WATCH_FONT_VALUE_TOP + WATCH_ABOUT_VALUE_HEIGHT) #define WATCH_CYWEEVER_TOP_VALUE_TOP (WATCH_CYWEEVER_TOP + WATCH_ABOUT_TITLE_HEIGHT) +#define WATCH_SUPERVISIONINFO_TOP (WATCH_CYWEEVER_TOP_VALUE_TOP + WATCH_ABOUT_VALUE_HEIGHT) namespace OHOS { @@ -136,6 +137,11 @@ namespace OHOS delete APNprotocol; APNprotocol = nullptr; + delete SupervisionInfoTitleButton; + SupervisionInfoTitleButton = nullptr; + delete SupervisionInfoTitle; + SupervisionInfoTitle = nullptr; + delete SystemAboutTheWatchScrollView; SystemAboutTheWatchScrollView = nullptr; } @@ -195,6 +201,7 @@ namespace OHOS SystemAboutTheWatchScrollView->SetSwipeACCLevel(200); /*设置手指抬起屏幕后的补偿距离。*/ SystemAboutTheWatchScrollView->RequestFocus(); SystemAboutTheWatchScrollView->SetRotateFactor(1.0); + SystemAboutTheWatchScrollView->SetScrollBlankSize(75, OHOS::UIAbstractScroll::Direction::BOTTOM); UIView::OnDragListener *draglistener = static_cast(SystemPresenter::GetInstance()); if (draglistener == nullptr) { @@ -678,6 +685,43 @@ namespace OHOS CyweeVersion->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); SystemAboutTheWatchScrollView->Add(CyweeVersion); + /* -------------------------------------------------------------------------- */ + SupervisionInfoTitleButton = new UILabelButton(); + if (SupervisionInfoTitleButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::SupervisionInfoTitleButton new fail!"); + return nullptr; + } + SupervisionInfoTitleButton->SetPosition((HORIZONTAL_RESOLUTION-380)/2, WATCH_SUPERVISIONINFO_TOP, 380, 100); + SupervisionInfoTitleButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + SupervisionInfoTitleButton->SetViewId(VIEW_ID_SUPERVISIONINFO_TITLE_BUTTON); + SupervisionInfoTitleButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED); + SupervisionInfoTitleButton->SetOnClickListener(SystemPresenter::GetInstance()); + SystemAboutTheWatchScrollView->Add(SupervisionInfoTitleButton); + /* -------------------------------------------------------------------------- */ + Config = { + .left = TITLE_LABEL_X, + .top = (int16_t)(SupervisionInfoTitleButton->GetY() + (SupervisionInfoTitleButton->GetHeight()-TITLE_LABEL_H) / 2), + .width = TITLE_LABEL_W, + .height = TITLE_LABEL_H, + .fontSize = TITLE_LABEL_FONTSIZE, + .lineHeigh = TITLE_LABEL_LINEHEIGHT, + .text = "监管信息", + .textId = 0, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, + }; + SupervisionInfoTitle = InitLabel(Config); + if (SupervisionInfoTitle == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::SupervisionInfoTitle new fail!"); + return nullptr; + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SupervisionInfoTitle:(%d,%d,%d,%d)", + SupervisionInfoTitle->GetX(), + SupervisionInfoTitle->GetY(), + SupervisionInfoTitle->GetWidth(), + SupervisionInfoTitle->GetHeight()); + SystemAboutTheWatchScrollView->Add(SupervisionInfoTitle); /* -------------------------------------------------------------------------- */ initViewStatus = true; return SystemAboutTheWatchScrollView; diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemPresenter.cpp index 18a97698f..fdd3fbec6 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemPresenter.cpp @@ -104,6 +104,10 @@ namespace OHOS { p_SystemView->ChangeView(FACTORYRESETVIEW, SYSTEMVIEW); } + else if (&view == p_SystemView->GetSystemScrollView(SUPERVISIONINFOVIEW)) + { + p_SystemView->ChangeView(SUPERVISIONINFOVIEW, SYSTEMVIEW); + } SystemPresenter::X_DRAG_FLAG = false; return true; } @@ -121,6 +125,12 @@ namespace OHOS return false; } + if (strcmp(view.GetViewId(), VIEW_ID_SUPERVISIONINFO_TITLE_BUTTON) == 0) // 点击进入监管信息界面 + { + p_SystemView->ChangeView(SYSTEMVIEW, SUPERVISIONINFOVIEW); + return true; + } + if (strcmp(view.GetViewId(), SYSTEMABOUTTHEWATCHVIEWID) == 0) // 连续点击进入产测模式 { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchTitle"); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemSuperVisionInfoView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemSuperVisionInfoView.cpp new file mode 100644 index 000000000..c66354252 --- /dev/null +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemSuperVisionInfoView.cpp @@ -0,0 +1,420 @@ +#include "system/include/SystemSuperVisionInfoView.h" +#include "system/include/SystemPresenter.h" +#include "wearable_log.h" +#include "common/screen.h" + +#define SUPERVISIONINFO_TITLE_HEIGHT 165 +#define SUPERVISIONINFO_VALUE_HEIGHT 55 +#define WatchModelTitle_POS_TOP 160 +#define WatchModel_POS_TOP (WatchModelTitle_POS_TOP + SUPERVISIONINFO_VALUE_HEIGHT) +#define inputInfoTitle_POS_TOP (WatchModelTitle_POS_TOP + SUPERVISIONINFO_TITLE_HEIGHT) +#define inputInfo1_POS_TOP (inputInfoTitle_POS_TOP + SUPERVISIONINFO_VALUE_HEIGHT) +#define inputInfo2_POS_TOP (inputInfo1_POS_TOP + SUPERVISIONINFO_VALUE_HEIGHT) +#define productNameTitle_POS_TOP (inputInfoTitle_POS_TOP + SUPERVISIONINFO_TITLE_HEIGHT) +#define productName_POS_TOP (productNameTitle_POS_TOP + SUPERVISIONINFO_VALUE_HEIGHT) +#define cmitTitle_POS_TOP (productNameTitle_POS_TOP + SUPERVISIONINFO_TITLE_HEIGHT) +#define cmit_POS_TOP (cmitTitle_POS_TOP + SUPERVISIONINFO_VALUE_HEIGHT) +#define companyNameTitle_POS_TOP (cmitTitle_POS_TOP + SUPERVISIONINFO_TITLE_HEIGHT) +#define companyName_POS_TOP (companyNameTitle_POS_TOP + SUPERVISIONINFO_VALUE_HEIGHT) + +namespace OHOS +{ + + static constexpr uint16_t TITLE_LABEL_X = 53; + static constexpr uint16_t TITLE_LABEL_W = 360; + static constexpr uint16_t TITLE_LABEL_H = 35; + static constexpr uint16_t TITLE_LABEL_FONTSIZE = 30; + static constexpr uint16_t TITLE_LABEL_LINEHEIGHT = 35; + + static constexpr uint16_t LABEL_X = 33; + static constexpr uint16_t LABEL_W = 400; + static constexpr uint16_t LABEL_H = 35; + static constexpr uint16_t LABEL_FONTSIZE = 30; + static constexpr uint16_t LABEL_LINEHEIGHT = 35; + + SystemSuperVisionInfoView::SystemSuperVisionInfoView() + { + } + SystemSuperVisionInfoView::~SystemSuperVisionInfoView() + { + ClearAll(); + } + + void SystemSuperVisionInfoView::ClearAll(void) + { + if (SystemSuperVisionInfoScrollView != nullptr) + { + SystemSuperVisionInfoScrollView->RemoveAll(); + delete SystemSuperVisionInfoScrollView; + SystemSuperVisionInfoScrollView = nullptr; + + if (title != nullptr) + { + delete title; + title = nullptr; + } + // 型号 + if (watchModelTitle != nullptr) + { + delete watchModelTitle; + watchModelTitle = nullptr; + } + if (watchModel != nullptr) + { + delete watchModel; + watchModel = nullptr; + } + // 输入信息 + if (inputInfoTitle != nullptr) + { + delete inputInfoTitle; + inputInfoTitle = nullptr; + } + if (inputInfo1 != nullptr) + { + delete inputInfo1; + inputInfo1 = nullptr; + } + if (inputInfo2 != nullptr) + { + delete inputInfo2; + inputInfo2 = nullptr; + } + // 产品名称 + if (productNameTitle != nullptr) + { + delete productNameTitle; + productNameTitle = nullptr; + } + if (productName != nullptr) + { + delete productName; + productName = nullptr; + } + // CMIT ID + if (cmitTitle != nullptr) + { + delete cmitTitle; + cmitTitle = nullptr; + } + if (cmit != nullptr) + { + delete cmit; + cmit = nullptr; + } + // 公司名称 + if (companyNameTitle != nullptr) + { + delete companyNameTitle; + companyNameTitle = nullptr; + } + if (companyName != nullptr) + { + delete companyName; + companyName = nullptr; + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::ClearAll"); + } + } + + UILabelExt *SystemSuperVisionInfoView::InitLabel_Ext(LabelConfig &labelConfig) + { + UILabelExt *label = new UILabelExt(); + if (label == nullptr) + { + return nullptr; + } + label->SetPosition(labelConfig.left, labelConfig.top, labelConfig.width, labelConfig.height); // 位置大小 + label->SetStyle(STYLE_TEXT_FONT, labelConfig.fontSize); // 字体大小 + label->SetStyle(STYLE_LINE_HEIGHT, labelConfig.lineHeigh); // 字体行高 + // label->SetText(labelConfig.text.c_str()); // 内容 + label->SetTextId(labelConfig.textId); + label->SetLineBreakMode(labelConfig.lineBreakMode); // 断行模式。 + label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP); + label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelConfig.fontSize); + return label; + } + + UILabel *SystemSuperVisionInfoView::InitLabel(LabelConfig &labelConfig) + { + UILabel *label = new UILabel(); + if (label == nullptr) + { + return nullptr; + } + label->SetPosition(labelConfig.left, labelConfig.top, labelConfig.width, labelConfig.height); // 位置大小 + label->SetStyle(STYLE_TEXT_FONT, labelConfig.fontSize); // 字体大小 + label->SetStyle(STYLE_LINE_HEIGHT, labelConfig.lineHeigh); // 字体行高 + label->SetText(labelConfig.text.c_str()); // 内容 + label->SetLineBreakMode(labelConfig.lineBreakMode); // 断行模式。 + label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP); + label->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, labelConfig.fontSize); + return label; + } + + UIScrollView *SystemSuperVisionInfoView::SystemSuperVisionInfoViewInit(void) + { + SystemSuperVisionInfoScrollView = new UIScrollView(); + if (SystemSuperVisionInfoScrollView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::SystemSuperVisionInfoScrollView new fail!"); + return nullptr; + } + SystemSuperVisionInfoScrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + SystemSuperVisionInfoScrollView->SetViewId(SYSTEMSUPERVISIONINFOVIEWID); + SystemSuperVisionInfoScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + SystemSuperVisionInfoScrollView->SetStyle(STYLE_BORDER_RADIUS, 1294); + SystemSuperVisionInfoScrollView->SetScrollBlankSize(30); + SystemSuperVisionInfoScrollView->SetReboundSize(30); + SystemSuperVisionInfoScrollView->SetDirection(1); + SystemSuperVisionInfoScrollView->SetThrowDrag(true); + SystemSuperVisionInfoScrollView->SetMaxScrollDistance(1000); + SystemSuperVisionInfoScrollView->SetSwipeACCLevel(200); /*设置手指抬起屏幕后的补偿距离。*/ + SystemSuperVisionInfoScrollView->RequestFocus(); + SystemSuperVisionInfoScrollView->SetRotateFactor(1.0); + SystemSuperVisionInfoScrollView->SetScrollBlankSize(30, OHOS::UIAbstractScroll::Direction::BOTTOM); + UIView::OnDragListener *draglistener = static_cast(SystemPresenter::GetInstance()); + if (draglistener == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::draglistener can not be nullptr!"); + return nullptr; + } + SystemSuperVisionInfoScrollView->SetOnDragListener(draglistener); + /* -------------------------------------------------------------------------- */ + LabelConfig Config = { + .left = 83, + .top = 50, + .width = 300, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "监管信息", + .textId = 0, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, + }; + title = InitLabel(Config); + if (title == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::title new fail!"); + return nullptr; + } + SystemSuperVisionInfoScrollView->Add(title); + /* -------------------------------------------------------------------------- */ + // 型号 + Config = { + .left = TITLE_LABEL_X, + .top = WatchModelTitle_POS_TOP, + .width = TITLE_LABEL_W, + .height = TITLE_LABEL_H, + .fontSize = TITLE_LABEL_FONTSIZE, + .lineHeigh = TITLE_LABEL_LINEHEIGHT, + .text = "型号", + .textId = 0, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, + }; + watchModelTitle = InitLabel(Config); + if (watchModelTitle == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::watchModelTitle new fail!"); + return nullptr; + } + SystemSuperVisionInfoScrollView->Add(watchModelTitle); + /* -------------------------------------------------------------------------- */ + Config = { + .left = LABEL_X, + .top = WatchModel_POS_TOP, + .width = LABEL_W, + .height = LABEL_H, + .fontSize = LABEL_FONTSIZE, + .lineHeigh = LABEL_LINEHEIGHT, + .text = "VITA", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + watchModel = InitLabel(Config); + if (watchModel == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::watchModel new fail!"); + return nullptr; + } + watchModel->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff)); + SystemSuperVisionInfoScrollView->Add(watchModel); + /* -------------------------------------------------------------------------- */ + // 输入信息 + Config = { + .left = TITLE_LABEL_X, + .top = inputInfoTitle_POS_TOP, + .width = TITLE_LABEL_W, + .height = TITLE_LABEL_H, + .fontSize = TITLE_LABEL_FONTSIZE, + .lineHeigh = TITLE_LABEL_LINEHEIGHT, + .text = "输入信息", + .textId = 0, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, + }; + inputInfoTitle = InitLabel(Config); + if (inputInfoTitle == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::inputInfoTitle new fail!"); + return nullptr; + } + SystemSuperVisionInfoScrollView->Add(inputInfoTitle); + /* -------------------------------------------------------------------------- */ + Config = { + .left = LABEL_X, + .top = inputInfo1_POS_TOP, + .width = LABEL_W, + .height = LABEL_H, + .fontSize = LABEL_FONTSIZE, + .lineHeigh = LABEL_LINEHEIGHT, + .text = "5.0 V DC", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + inputInfo1 = InitLabel(Config); + if (inputInfo1 == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::inputInfo1 new fail!"); + return nullptr; + } + inputInfo1->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff)); + SystemSuperVisionInfoScrollView->Add(inputInfo1); + /* -------------------------------------------------------------------------- */ + Config = { + .left = LABEL_X, + .top = (int16_t)(inputInfo1->GetY() + inputInfo1->GetHeight() + 10), + .width = LABEL_W, + .height = LABEL_H, + .fontSize = LABEL_FONTSIZE, + .lineHeigh = LABEL_LINEHEIGHT, + .text = "500mA Max", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + inputInfo2 = InitLabel(Config); + if (inputInfo2 == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::inputInfo2 new fail!"); + return nullptr; + } + inputInfo2->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff)); + SystemSuperVisionInfoScrollView->Add(inputInfo2); + /* -------------------------------------------------------------------------- */ + // 产品名称 + Config = { + .left = TITLE_LABEL_X, + .top = productNameTitle_POS_TOP, + .width = TITLE_LABEL_W, + .height = TITLE_LABEL_H, + .fontSize = TITLE_LABEL_FONTSIZE, + .lineHeigh = TITLE_LABEL_LINEHEIGHT, + .text = "产品名称", + .textId = 0, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, + }; + productNameTitle = InitLabel(Config); + if (productNameTitle == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::productNameTitle new fail!"); + return nullptr; + } + SystemSuperVisionInfoScrollView->Add(productNameTitle); + /* -------------------------------------------------------------------------- */ + Config = { + .left = LABEL_X, + .top = productName_POS_TOP, + .width = LABEL_W, + .height = LABEL_H, + .fontSize = LABEL_FONTSIZE, + .lineHeigh = LABEL_LINEHEIGHT, + .text = "智能手表", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + productName = InitLabel(Config); + if (productName == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::productName new fail!"); + return nullptr; + } + productName->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff)); + SystemSuperVisionInfoScrollView->Add(productName); + /* -------------------------------------------------------------------------- */ + // CMIT ID + Config = { + .left = TITLE_LABEL_X, + .top = cmitTitle_POS_TOP, + .width = TITLE_LABEL_W, + .height = TITLE_LABEL_H, + .fontSize = TITLE_LABEL_FONTSIZE, + .lineHeigh = TITLE_LABEL_LINEHEIGHT, + .text = "CMIT ID", + .textId = 0, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, + }; + cmitTitle = InitLabel(Config); + if (cmitTitle == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::cmitTitle new fail!"); + return nullptr; + } + SystemSuperVisionInfoScrollView->Add(cmitTitle); + /* -------------------------------------------------------------------------- */ + Config = { + .left = LABEL_X, + .top = cmit_POS_TOP, + .width = LABEL_W, + .height = LABEL_H, + .fontSize = LABEL_FONTSIZE, + .lineHeigh = LABEL_LINEHEIGHT, + .text = "XXXXXXXXXXX", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + cmit = InitLabel(Config); + if (cmit == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::cmit new fail!"); + return nullptr; + } + cmit->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff)); + SystemSuperVisionInfoScrollView->Add(cmit); + /* -------------------------------------------------------------------------- */ + // 公司名称 + Config = { + .left = TITLE_LABEL_X, + .top = companyNameTitle_POS_TOP, + .width = TITLE_LABEL_W, + .height = TITLE_LABEL_H, + .fontSize = TITLE_LABEL_FONTSIZE, + .lineHeigh = TITLE_LABEL_LINEHEIGHT, + .text = "杭州扶鹰健康\n科技有限公司", + .textId = 0, + .lineBreakMode = UILabel::LINE_BREAK_ADAPT, + }; + companyNameTitle = InitLabel(Config); + if (companyNameTitle == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::companyNameTitle new fail!"); + return nullptr; + } + companyNameTitle->SetX((HORIZONTAL_RESOLUTION - companyNameTitle->GetWidth()) / 2); + SystemSuperVisionInfoScrollView->Add(companyNameTitle); + /* -------------------------------------------------------------------------- */ + Config = { + .left = LABEL_X, + .top = (int16_t)(companyNameTitle->GetY() + companyNameTitle->GetHeight() + 35), + .width = LABEL_W, + .height = LABEL_H, + .fontSize = LABEL_FONTSIZE, + .lineHeigh = LABEL_LINEHEIGHT, + .text = "中国制造", + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + companyName = InitLabel(Config); + if (companyName == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperVisionInfoView::companyName new fail!"); + return nullptr; + } + companyName->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff)); + SystemSuperVisionInfoScrollView->Add(companyName); + /* -------------------------------------------------------------------------- */ + return SystemSuperVisionInfoScrollView; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemView.cpp index 983a75c60..7275990c0 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/system/src/SystemView.cpp @@ -107,6 +107,11 @@ namespace OHOS delete p_ShutDownImageAnimatorView; p_ShutDownImageAnimatorView = nullptr; } + if (p_SystemSuperVisionInfoView != nullptr) + { + delete p_SystemSuperVisionInfoView; + p_SystemSuperVisionInfoView = nullptr; + } for (int i = SYSTEMVIEW; i < MAX_SYSTEMVIEWID; i++) { SystemScrollView[i] = nullptr; @@ -455,6 +460,24 @@ namespace OHOS return true; } + // 监管信息 + bool SystemView::ChangeToSystemSuperVisionInfoView(int16_t thisView) + { + if (SystemScrollView[thisView] == nullptr) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeToSystemSuperVisionInfoView"); + p_SystemSuperVisionInfoView = new SystemSuperVisionInfoView(); + if (p_SystemSuperVisionInfoView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); + return false; + } + SystemScrollView[thisView] = p_SystemSuperVisionInfoView->SystemSuperVisionInfoViewInit(); + AddViewToRootContainer(SystemScrollView[thisView]); + } + return true; + } + struct SystemViewMapper { const int16_t viewId; @@ -468,6 +491,7 @@ namespace OHOS {RESTARTVIEW, &SystemView::ChangeToSystemRestartView}, {SHUTDOWNVIEW, &SystemView::ChangeToSystemShutdownView}, {SHUTDOWNANIMATIONVIEW, &SystemView::ChangeToSystemShutdownAnimatorView}, + {SUPERVISIONINFOVIEW, &SystemView::ChangeToSystemSuperVisionInfoView}, }; // 根据传入的interface参数执行相应视图ID关联的成员函数。 diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/src/WatchQRCodeView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/src/WatchQRCodeView.cpp index 237cc54a2..485b93511 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/src/WatchQRCodeView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/watchQRcode/src/WatchQRCodeView.cpp @@ -118,15 +118,15 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "WatchQRCodeView::TitleLabel new label fail"); return false; } - TitleLabel->SetPosition(83, 50, 300, 35); - TitleLabel->SetStyle(STYLE_TEXT_FONT, 30); - TitleLabel->SetStyle(STYLE_LINE_HEIGHT, 35); + TitleLabel->SetPosition((Screen::GetInstance().GetWidth() - 326) / 2, 62, 326, 30); + TitleLabel->SetStyle(STYLE_TEXT_FONT, 24); + TitleLabel->SetStyle(STYLE_LINE_HEIGHT, 30); uint8_t ble_name[30] = {0}; uint32_t ble_name_len = sizeof(ble_name); errcode_t ret = uapi_get_nv_btname(ble_name, &ble_name_len); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "get btname %s ,ret 0x%X\n", ble_name, ret); TitleLabel->SetText((char *)ble_name); - TitleLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 30); + TitleLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 24); TitleLabel->SetRollSpeed(23); TitleLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); TitleLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index 5ab34cca8..4d395dc3d 100644 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -1210,6 +1210,7 @@ target = { "pgnss_sample", # "gnss_sample", "cyweeBleService", + "aiMediaService", ], 'image_analysis': False, 'fs_image_path':'fd272', -- 2.17.1