From: 罗正yun <1732036298@qq.com> Date: Thu, 25 Jan 2024 08:58:30 +0000 (+0800) Subject: 系统视图修改,删除掉不必要图片 X-Git-Tag: release_V1.2.70_20241020_135402~1326 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=cd328666ff156238fd7f133a75efb60b703812c8;p=mirrors%2FFD230.git 系统视图修改,删除掉不必要图片 --- diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h index f261847a7..06c4d1bb6 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h @@ -207,20 +207,20 @@ namespace OHOS static constexpr const char *PNG_Message_Wechat = APP_RES_PATH "/message/WeChat-icon.bin"; // 微信消息 static constexpr const char *PNG_Message_QQ = APP_RES_PATH "/message/QQ-icon.bin"; // QQ消息 /* ---------------------------------- 通用图片 ---------------------------------- */ - static constexpr const char *PNG_CHECKBOX_OFF_IMAGE = APP_RES_PATH "/CHECKBOX_OFF.bin"; // checkbox未选中图片 - static constexpr const char *PNG_CHECKBOX_ON_IMAGE = APP_RES_PATH "/CHECKBOX_ON.bin"; // checkbox选中图片 - static constexpr const char *PNG_SETTING_NEXT_IMAGE = APP_RES_PATH "/SETTING_NEXT.bin"; // 箭头图片 - static constexpr const char *PNG_SETTING_BACKGROUND_IMAGE = APP_RES_PATH "/SETTING_BACKGROUND.bin"; // 按钮的背景图片 - static constexpr const char *PNG_VOLUME_CONTROL_VECTOR = APP_RES_PATH "/VolumeControlVector.bin"; // 调节音量图片 - static constexpr const char *PNG_BRIGHTNESS_CONTROL_VECTOR = APP_RES_PATH "/BringhtnessContuolVector.bin"; // 调节亮度图片 - static constexpr const char *PNG_SYSTEM_CHECK_ON_IMAGE = APP_RES_PATH "/SYSTEM_CheckOn.bin"; // 勾 - static constexpr const char *PNG_SYSTEM_CHECK_OFF_IMAGE = APP_RES_PATH "/SYSTEM_CheckOff.bin"; // 叉 - static constexpr const char *PNG_TOGGLEBUTTON_OFF_IMAGE = APP_RES_PATH "/TOGGLEBUTTON_OFF.bin"; // togglebuttton未选中图片 - static constexpr const char *PNG_TOGGLEBUTTON_ON_IMAGE = APP_RES_PATH "/TOGGLEBUTTON_ON.bin"; // togglebuttton选中图片 - static constexpr const char *PNG_SYSTEM_VOLUME_IMAGE = APP_RES_PATH "/SYSTEM_VOLUME.bin"; // 系统音量 - static constexpr const char *PNG_CALL_VOLUME_IMAGE = APP_RES_PATH "/CALL_VOLUME.bin"; // 通话音量 - static constexpr const char *PNG_MEDIA_VOLUME_IMAGE = APP_RES_PATH "/MEDIA_VOLUME.bin"; // 媒体音量 - static constexpr const char *PNG_FAST_TRAINING_ATTENTION_IMAGE = APP_RES_PATH "/FastTrainingAttentionVector.bin"; // 快速训练选中操过三个后出现 + static constexpr const char *PNG_CHECKBOX_OFF_IMAGE = APP_RES_PATH "/CHECKBOX_OFF.bin"; // checkbox未选中图片 + static constexpr const char *PNG_CHECKBOX_ON_IMAGE = APP_RES_PATH "/CHECKBOX_ON.bin"; // checkbox选中图片 + static constexpr const char *PNG_SETTING_NEXT_IMAGE = APP_RES_PATH "/SETTING_NEXT.bin"; // 箭头图片 + static constexpr const char *PNG_SETTING_BACKGROUND_IMAGE = APP_RES_PATH "/SETTING_BACKGROUND.bin"; // 按钮的背景图片 + static constexpr const char *PNG_VOLUME_CONTROL_VECTOR = APP_RES_PATH "/VolumeControlVector.bin"; // 调节音量图片 + static constexpr const char *PNG_BRIGHTNESS_CONTROL_VECTOR = APP_RES_PATH "/BringhtnessContuolVector.bin"; // 调节亮度图片 + static constexpr const char *PNG_SYSTEM_CHECK_ON_IMAGE = APP_RES_PATH "/SYSTEM_CheckOn.bin"; // 勾 + static constexpr const char *PNG_SYSTEM_CHECK_OFF_IMAGE = APP_RES_PATH "/SYSTEM_CheckOff.bin"; // 叉 + static constexpr const char *PNG_TOGGLEBUTTON_OFF_IMAGE = APP_RES_PATH "/TOGGLEBUTTON_OFF.bin"; // togglebuttton未选中图片 + static constexpr const char *PNG_TOGGLEBUTTON_ON_IMAGE = APP_RES_PATH "/TOGGLEBUTTON_ON.bin"; // togglebuttton选中图片 + static constexpr const char *PNG_SYSTEM_VOLUME_IMAGE = APP_RES_PATH "/SYSTEM_VOLUME.bin"; // 系统音量 + static constexpr const char *PNG_CALL_VOLUME_IMAGE = APP_RES_PATH "/CALL_VOLUME.bin"; // 通话音量 + static constexpr const char *PNG_MEDIA_VOLUME_IMAGE = APP_RES_PATH "/MEDIA_VOLUME.bin"; // 媒体音量 + static constexpr const char *PNG_ORANGE_ATTENTION_VECTOR_IMAGE = APP_RES_PATH "/OrangeAttentionVector.bin"; // 橘黄色感叹号图标 static constexpr const char *PNG_ANIMATOR1_IMAGE = APP_RES_PATH "/Record/animator1.bin"; static constexpr const char *PNG_ANIMATOR2_IMAGE = APP_RES_PATH "/Record/animator2.bin"; /* -------------------------------- 已删除的不必要图片 ------------------------------- */ diff --git a/code/sdk/application/wearable/nativeapp/nativeui/secondaryfunction/src/FastTrainingAttentionView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/secondaryfunction/src/FastTrainingAttentionView.cpp index b636311fc..35d0b96ef 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/secondaryfunction/src/FastTrainingAttentionView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/secondaryfunction/src/FastTrainingAttentionView.cpp @@ -77,7 +77,7 @@ namespace OHOS } image7_->SetPosition(193, 121); image7_->Resize(80, 80); - image7_->SetSrc(PNG_FAST_TRAINING_ATTENTION_IMAGE); + image7_->SetSrc(PNG_ORANGE_ATTENTION_VECTOR_IMAGE); // Add to scrollView1 scrollView1_->Add(image7_); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemAboutTheWatchView.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemAboutTheWatchView.h index 916f3b5ea..03249d47e 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemAboutTheWatchView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemAboutTheWatchView.h @@ -47,9 +47,7 @@ namespace OHOS UILabel *LANAddress = nullptr; UILabel *FONTTitle = nullptr; UILabel *FONT = nullptr; - - UIImageView *image = nullptr; - UIView::OnDragListener *draglistener{nullptr}; + bool initViewStatus{false}; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemLanguageView.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemLanguageView.h index afb6b9800..294bb2bb3 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemLanguageView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemLanguageView.h @@ -9,10 +9,6 @@ #include "components/ui_image_view.h" namespace OHOS { - static const char *SIMPLIFIED_CHINESE_BUTTON = "SimplifiedChineseButton"; // 简体中文 button - static const char *ENGLISH_BUTTON = "EnglishButton"; // English button - static const char *SIMPLIFIED_CHINESE_CHECKBOX = "SimplifiedChineseCheckBox"; // 简体中文 checkbox - static const char *ENGLISH_CHECKBOX = "EnglishCheckBox"; // English checkbox class SystemLanguageView { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemPresenter.h index 7a827129e..7d23daf31 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemPresenter.h @@ -2,40 +2,51 @@ #define SYSTEM_PRESENTER_H #include "Presenter.h" - #include "SystemView.h" - +#include "components/ui_radio_button.h" namespace OHOS { + + static const char *SIMPLIFIED_CHINESE_CHECKBOX = "SimplifiedChineseCheckBox"; // 简体中文 + static const char *ENGLISH_CHECKBOX = "EnglishCheckBox"; // English + class RadiobuttonOnChangeListener : public UICheckBox::OnChangeListener + { + public: + RadiobuttonOnChangeListener(UIRadioButton *uiView) + { + m_uiView = uiView; + } + ~RadiobuttonOnChangeListener() {} + bool isChineseRadioButtonSelected(); + bool isEnglishRadioButtonSelected(); + bool OnChange(UICheckBox::UICheckBoxState state) override; + + private: + UIRadioButton *m_uiView{nullptr}; + }; + class SystemView; - class SystemPresenter : public Presenter, - public UIView::OnClickListener, - public UIView::OnDragListener + public UIView::OnClickListener, + public UIView::OnDragListener { public: SystemPresenter(); virtual ~SystemPresenter(); - - void OnStart() override; - void OnPause() override; - void OnResume() override; - void OnStop() override; - - static SystemPresenter *GetInstance(); - - private: - //因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承; - bool OnClick(UIView &view, const ClickEvent &event) override; - bool OnDrag(UIView& view, const DragEvent& event) override; - bool OnDragEnd(UIView &view, const DragEvent &event) override; - }; -} //namespace OHOS - - - + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + static SystemPresenter *GetInstance(); + private: + // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承; + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + bool OnDragEnd(UIView &view, const DragEvent &event) override; + }; +} // namespace OHOS #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemSuperviseView.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemSuperviseView.h index 2939f4e87..3438a7acf 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemSuperviseView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemSuperviseView.h @@ -3,8 +3,6 @@ #include "BaseView.h" #include "View.h" - -#include "components/ui_view_group.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" namespace OHOS @@ -21,14 +19,13 @@ namespace OHOS void ClearAll(void); private: - UIViewGroup *container_ = nullptr; UIScrollView *SystemSuperviseViewScrollView = nullptr; - UIView::OnDragListener *draglistener{nullptr}; UILabel *Title = nullptr; UILabel *ProductModel = nullptr; UILabel *ProductModelName = nullptr; UILabel *CMIT = nullptr; UILabel *CMITName = nullptr; + bool initViewStatus{false}; }; } // namespace OHOS #endif // SLEEPDETAIL_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemAboutTheWatchView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemAboutTheWatchView.cpp index a961a8719..7f9b49bcf 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemAboutTheWatchView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemAboutTheWatchView.cpp @@ -25,6 +25,42 @@ namespace OHOS return g_pSystemAboutTheWatchView; } + void SystemAboutTheWatchView::ClearAll() + { + if (initViewStatus == true) + { + SystemAboutTheWatchScrollView->RemoveAll(); + delete SystemAboutTheWatchTitle; + SystemAboutTheWatchTitle = nullptr; + delete WatchNameTitle; + WatchNameTitle = nullptr; + delete WatchName; + WatchName = nullptr; + delete FirmwareVersionTitle; + FirmwareVersionTitle = nullptr; + delete FirmwareVersion; + FirmwareVersion = nullptr; + delete AlgorithmVersionTitle; + AlgorithmVersionTitle = nullptr; + delete AlgorithmVersion; + AlgorithmVersion = nullptr; + delete BluetoothAddressTitle; + BluetoothAddressTitle = nullptr; + delete BluetoothAddress; + BluetoothAddress = nullptr; + delete LANAddressTitle; + LANAddressTitle = nullptr; + delete LANAddress; + LANAddress = nullptr; + delete FONTTitle; + FONTTitle = nullptr; + delete FONT; + FONT = nullptr; + delete SystemAboutTheWatchScrollView; + SystemAboutTheWatchScrollView = nullptr; + } + } + UILabel *SystemAboutTheWatchView::InitLabel(LabelConfig &labelConfig) { UILabel *label = new UILabel(); @@ -56,7 +92,7 @@ namespace OHOS SystemAboutTheWatchScrollView->SetScrollBlankSize(35); SystemAboutTheWatchScrollView->SetReboundSize(50); SystemAboutTheWatchScrollView->SetDirection(1); - draglistener = static_cast(SystemPresenter::GetInstance()); + UIView::OnDragListener *draglistener = static_cast(SystemPresenter::GetInstance()); if (draglistener == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!"); @@ -314,40 +350,7 @@ namespace OHOS } LANAddress->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); SystemAboutTheWatchScrollView->Add(LANAddress); - + initViewStatus = true; return SystemAboutTheWatchScrollView; } - - void SystemAboutTheWatchView::ClearAll() - { - SystemAboutTheWatchScrollView->RemoveAll(); - delete SystemAboutTheWatchTitle; - SystemAboutTheWatchTitle = nullptr; - delete WatchNameTitle; - WatchNameTitle = nullptr; - delete WatchName; - WatchName = nullptr; - delete FirmwareVersionTitle; - FirmwareVersionTitle = nullptr; - delete FirmwareVersion; - FirmwareVersion = nullptr; - delete AlgorithmVersionTitle; - AlgorithmVersionTitle = nullptr; - delete AlgorithmVersion; - AlgorithmVersion = nullptr; - delete BluetoothAddressTitle; - BluetoothAddressTitle = nullptr; - delete BluetoothAddress; - BluetoothAddress = nullptr; - delete LANAddressTitle; - LANAddressTitle = nullptr; - delete LANAddress; - LANAddress = nullptr; - delete FONTTitle; - FONTTitle = nullptr; - delete FONT; - FONT = nullptr; - delete SystemAboutTheWatchScrollView; - SystemAboutTheWatchScrollView = nullptr; - } } \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemFactoryResetPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemFactoryResetPresenter.cpp index 1f49d3673..358f02239 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemFactoryResetPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemFactoryResetPresenter.cpp @@ -66,7 +66,6 @@ namespace OHOS // 根据控件id查找是哪个控件触发了点击回调 if (strcmp(view.GetViewId(), FACTORYRESET_CHECKON) == 0) { - printf("file:%s line:%d\n shoutdown button check on being clicked\n", __FILE__, __LINE__); return true; } else if (strcmp(view.GetViewId(), FACTORYRESET_CHECKOFF) == 0) diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemLanguageView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemLanguageView.cpp index 5d11053ea..e0457aee1 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemLanguageView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemLanguageView.cpp @@ -215,6 +215,8 @@ namespace OHOS return nullptr; } SetRadioButtonSelectStatus(*SimplifiedChineseRadioButton, true); + UICheckBox::OnChangeListener* SimplifiedChineseRadioButtonChange = static_cast(new RadiobuttonOnChangeListener(SimplifiedChineseRadioButton)); + SimplifiedChineseRadioButton->SetOnChangeListener(SimplifiedChineseRadioButtonChange); scrollView->Add(SimplifiedChineseRadioButton); /* --------------------------- EnglishRadioButton --------------------------- */ radioButtonConfig.left = 300; @@ -226,6 +228,8 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemLanguageView::EnglishRadioButton new fail!"); return nullptr; } + UICheckBox::OnChangeListener* EnglishRadioButtonChange = static_cast(new RadiobuttonOnChangeListener(EnglishRadioButton)); + EnglishRadioButton->SetOnChangeListener(EnglishRadioButtonChange); scrollView->Add(EnglishRadioButton); initViewStatus = true; return scrollView; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemPresenter.cpp index 9a3152243..617357c0c 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemPresenter.cpp @@ -61,7 +61,7 @@ namespace OHOS if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) { - NativeAbility::GetInstance().ChangeSlice(VIEW_SETTING); + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM); return true; } return false; @@ -93,4 +93,55 @@ namespace OHOS } return false; } + + /// @brief 简体中文单选按钮被选中 + /// @param void + /// @return true 表示选中 ,false 表示未选中 + bool RadiobuttonOnChangeListener::isChineseRadioButtonSelected(void) + { + if (m_uiView->GetState() == UICheckBox::SELECTED && m_uiView->GetViewId() == SIMPLIFIED_CHINESE_CHECKBOX) + { + return true; + } + return false; + } + + /// @brief 英语单选按钮被选中 + /// @param void + /// @return true 表示选中 ,false 表示未选中 + bool RadiobuttonOnChangeListener::isEnglishRadioButtonSelected(void) + { + if (m_uiView->GetState() == UICheckBox::SELECTED && m_uiView->GetViewId() == ENGLISH_CHECKBOX) + { + return true; + } + return false; + } + + bool RadiobuttonOnChangeListener::OnChange(UICheckBox::UICheckBoxState state) + { + switch (state) + { + case UICheckBox::SELECTED: + if (isChineseRadioButtonSelected()) + { + // loadChineseLanguageResource();//加载中文资源 + // updateUIWithChineseText();//更新中文文本 + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Switched to Chinese language"); + } + else if (isEnglishRadioButtonSelected()) + { + // loadEnglishLanguageResource(); //加载英语资源 + // updateUIWithEnglishText(); //更新英语文本 + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Switched to English language"); + } + break; + case UICheckBox::UNSELECTED: + // Handle unselected state if needed + break; + default: + break; + } + return true; + } } \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemSuperviseView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemSuperviseView.cpp index 39a20c958..5e8fb5fd0 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemSuperviseView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemSuperviseView.cpp @@ -8,13 +8,13 @@ namespace OHOS SystemSuperviseView::SystemSuperviseView() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemSuperviseView::SystemSuperviseView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperviseView::SystemSuperviseView"); g_pSystemSuperviseView = this; } SystemSuperviseView::~SystemSuperviseView() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemSuperviseView::~SystemSuperviseView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemSuperviseView::~SystemSuperviseView"); ClearAll(); g_pSystemSuperviseView = nullptr; } @@ -23,6 +23,27 @@ namespace OHOS { return g_pSystemSuperviseView; } + + void SystemSuperviseView::ClearAll() + { + if (initViewStatus == true) + { + SystemSuperviseViewScrollView->RemoveAll(); + delete Title; + Title = nullptr; + delete ProductModel; + ProductModel = nullptr; + delete ProductModelName; + ProductModelName = nullptr; + delete CMIT; + CMIT = nullptr; + delete CMITName; + CMITName = nullptr; + delete SystemSuperviseViewScrollView; + SystemSuperviseViewScrollView = nullptr; + } + } + UILabel *SystemSuperviseView::InitLabel(int left, int top, int width, int height, const char *text, const char *viewId, int fontSize, int fontlineHeigh, uint16_t speed) { UILabel *label = new UILabel(); @@ -49,7 +70,7 @@ namespace OHOS SystemSuperviseViewScrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); SystemSuperviseViewScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); SystemSuperviseViewScrollView->SetStyle(STYLE_BORDER_RADIUS, 1294); - draglistener = static_cast(SystemPresenter::GetInstance()); + UIView::OnDragListener *draglistener = static_cast(SystemPresenter::GetInstance()); if (draglistener == nullptr) { return nullptr; @@ -99,48 +120,14 @@ namespace OHOS CMITName->SetPosition(37, 367, 400, 30); // 位置大小 CMITName->SetStyle(STYLE_TEXT_FONT, 26); // 字体大小 CMITName->SetStyle(STYLE_LINE_HEIGHT, 30); // 字体行高 - CMITName->SetText("V02.03.01"); // 内容 + CMITName->SetText("V1.0"); // 内容 CMITName->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); // 断行模式。 CMITName->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); CMITName->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); CMITName->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); SystemSuperviseViewScrollView->Add(CMITName); - + initViewStatus = true; return SystemSuperviseViewScrollView; } - void SystemSuperviseView::ClearAll() - { - SystemSuperviseViewScrollView->RemoveAll(); - delete draglistener; - draglistener = nullptr; - if (Title != nullptr) - { - delete Title; - Title = nullptr; - } - if (ProductModel != nullptr) - { - delete ProductModel; - ProductModel = nullptr; - } - if (ProductModelName != nullptr) - { - delete ProductModelName; - ProductModelName = nullptr; - } - if (CMIT != nullptr) - { - delete CMIT; - CMIT = nullptr; - } - if (CMITName != nullptr) - { - delete CMITName; - CMITName = nullptr; - } - delete SystemSuperviseViewScrollView; - SystemSuperviseViewScrollView = nullptr; - } - } \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemView.cpp index 10b994873..52d180a88 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemView.cpp @@ -24,6 +24,30 @@ namespace OHOS return g_pSystemView; } + void SystemView::ClearAll() + { + if (initViewStatus == true) + { + SystemScrollView[0]->RemoveAll(); + delete p_SystemAboutTheWatchView; + p_SystemAboutTheWatchView = nullptr; + delete p_SystemSuperviseView; + p_SystemSuperviseView = nullptr; + delete p_SystemLanguageView; + p_SystemLanguageView = nullptr; + delete SystemLabel; + SystemLabel = nullptr; + delete AboutTheWatchButton; + AboutTheWatchButton = nullptr; + delete SuperviseButton; + SuperviseButton = nullptr; + delete SystemLanguageButton; + SystemLanguageButton = nullptr; + delete FactoryResetButton; + FactoryResetButton = nullptr; + } + } + /// @brief 设置SystemScrollView /// @param void /// @return true 设置成功,false 失败 @@ -156,34 +180,10 @@ namespace OHOS initViewStatus = true; } - void SystemView::ClearAll() - { - if (initViewStatus == true) - { - SystemScrollView[0]->RemoveAll(); - delete p_SystemAboutTheWatchView; - p_SystemAboutTheWatchView = nullptr; - delete p_SystemSuperviseView; - p_SystemSuperviseView = nullptr; - delete p_SystemLanguageView; - p_SystemLanguageView = nullptr; - delete SystemLabel; - SystemLabel = nullptr; - delete AboutTheWatchButton; - AboutTheWatchButton = nullptr; - delete SuperviseButton; - SuperviseButton = nullptr; - delete SystemLanguageButton; - SystemLanguageButton = nullptr; - delete FactoryResetButton; - FactoryResetButton = nullptr; - } - } - - // 0.跳转到系统视图,其他视图都市通过这个视图跳转 + // 0.跳转到系统视图,其他视图都市通过这个视图跳转 bool SystemView::ChangeSystemView(int16_t thisView) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemView"); RootView::GetInstance()->Add(SystemScrollView[thisView]); return true; } @@ -193,7 +193,7 @@ namespace OHOS { if (SystemScrollView[thisView] == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemAboutView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemAboutView"); p_SystemAboutTheWatchView = new SystemAboutTheWatchView(); if (p_SystemAboutTheWatchView == nullptr) { @@ -211,7 +211,7 @@ namespace OHOS { if (SystemScrollView[thisView] == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemSuperviseView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemSuperviseView"); p_SystemSuperviseView = new SystemSuperviseView(); if (p_SystemSuperviseView == nullptr) { @@ -229,7 +229,7 @@ namespace OHOS { if (SystemScrollView[thisView] == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemLanguageView"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemLanguageView"); p_SystemLanguageView = new SystemLanguageView(); if (p_SystemLanguageView == nullptr) { @@ -304,7 +304,7 @@ namespace OHOS View::OnSetUpView(); if (SystemScrollView[0] == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SystemView:: OnSetUpView has nullptr"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: OnSetUpView has nullptr"); return; } SystemScrollView[0]->Add(SystemLabel); diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/FastTrainingAttentionVector.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/OrangeAttentionVector.bin similarity index 100% rename from code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/FastTrainingAttentionVector.bin rename to code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/OrangeAttentionVector.bin diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_REBOOT.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_REBOOT.bin deleted file mode 100644 index ac88ca2bb..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_REBOOT.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_SHOUTDOWM.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_SHOUTDOWM.bin deleted file mode 100644 index 5fb1c58ef..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_SHOUTDOWM.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/reboot.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/reboot.bin deleted file mode 100644 index fb50225d1..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/reboot.bin and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/shoutdown.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/shoutdown.bin deleted file mode 100644 index 8ee51a27d..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/shoutdown.bin and /dev/null differ