From: 罗正yun <1732036298@qq.com> Date: Mon, 22 Jan 2024 08:00:03 +0000 (+0800) Subject: 设置中添加系统视图 X-Git-Tag: release_V1.2.70_20241020_135402~1348 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=475dea38f5cef38806eff87175475660b52b0dcb;p=mirrors%2FFD230.git 设置中添加系统视图 --- diff --git a/code/sdk/application/wearable/nativeapp/CMakeLists.txt b/code/sdk/application/wearable/nativeapp/CMakeLists.txt index ac1109e35..55aa8296d 100755 --- a/code/sdk/application/wearable/nativeapp/CMakeLists.txt +++ b/code/sdk/application/wearable/nativeapp/CMakeLists.txt @@ -212,6 +212,23 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/WeatherControlView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/WeatherView.cpp + #系统 + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemAboutPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemAboutView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemSupervisePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemSuperviseView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemLanguagePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemLanguageView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemRebootPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemRebootView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemShoutDownPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemShoutDownView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemFactoryResetPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemFactoryResetView.cpp + + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassControlView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassCalibrationView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/compass/src/CompassModel.cpp diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h index 9beb592ca..8cdaf6c7a 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h @@ -44,6 +44,13 @@ typedef enum : uint16_t VIEW_WEATHER_REPORT, // 气象报告 VIEW_FUTURE_WEATHER, // 未来天气 VIEW_GET_WEATHER_DATA_ERROR, // 获取天气数据失败 + VIEW_SYSTEM, // 系统 + VIEW_SYSTEM_ABOUT_WATCH, // 系统:关于手表 + VIEW_SYSTEM_SUPERVISE, // 系统:监管 + VIEW_SYSTEM_SYSTEM_LANGUAGE, // 系统:系统语言 + VIEW_SYSTEM_REBOOT, // 系统:重新启动 + VIEW_SYSTEM_SHOUTDOWN, // 系统:关机 + VIEW_SYSTEM_FACTORY_RESET, // 系统:恢复出厂设置 /* -------------------------------------------------------------------------- */ VIEW_MAIN_TEMP, // 体温界面(暂时不用) VIEW_OFFLINEVOICE, // 语音助手界面(暂时不用) diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h index e5bc6349b..cda756770 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h @@ -47,6 +47,13 @@ namespace OHOS void InitFutureWeatherSlice(void); void InitGetWeatherDataErrorSlice(void); /* -------------------------------------------------------------------------- */ + void InitSystemSlice(void); + void InitSystemAboutWatchSlice(void); + void InitSystemSuperviseSlice(void); + void InitSystemLanguageSlice(void); + void InitSystemRebootSlice(void); + void InitSystemShoutDownSlice(void); + void InitSystemFactoryResetSlice(void); private: void InitAllNativeSlices(void); diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h index b275a696e..e347034eb 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/UiConfig.h @@ -206,6 +206,8 @@ namespace OHOS 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_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_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/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp index d90ee3c96..7763c66ed 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp @@ -69,6 +69,21 @@ #include "weather/include/GetWeatherDataErrorPresenter.h" #include "weather/include/GetWeatherDataErrorView.h" +#include "system/include/SystemPresenter.h" +#include "system/include/SystemView.h" +#include "system/include/SystemAboutPresenter.h" +#include "system/include/SystemAboutView.h" +#include "system/include/SystemSupervisePresenter.h" +#include "system/include/SystemSuperviseView.h" +#include "system/include/SystemLanguagePresenter.h" +#include "system/include/SystemLanguageView.h" +#include "system/include/SystemRebootPresenter.h" +#include "system/include/SystemRebootView.h" +#include "system/include/SystemShoutDownPresenter.h" +#include "system/include/SystemShoutDownView.h" +#include "system/include/SystemFactoryResetPresenter.h" +#include "system/include/SystemFactoryResetView.h" + #include "BluetoothHeadsetEvent.h" #include "graphic_hardware_config.h" #include "graphic_service.h" @@ -103,15 +118,22 @@ namespace OHOS {VIEW_INDOORWALK, &NativeLauncher::InitIndoorWalkSlice}, {VIEW_SHUTDOWN_OR_REBOOT, &NativeLauncher::InitRebootSlice}, {VIEW_DIAL, &NativeLauncher::InitDialSlice}, - {VIEW_WEATHER,&NativeLauncher::InitWeatherSlice}, //天气 - {VIEW_WEATHER_REPORT,&NativeLauncher::InitWeatherReportSlice}, //气象报告 - {VIEW_FUTURE_WEATHER,&NativeLauncher::InitFutureWeatherSlice}, //未来天气 - {VIEW_GET_WEATHER_DATA_ERROR,&NativeLauncher::InitGetWeatherDataErrorSlice}, //获取天气数据失败 + {VIEW_WEATHER, &NativeLauncher::InitWeatherSlice}, // 天气 + {VIEW_WEATHER_REPORT, &NativeLauncher::InitWeatherReportSlice}, // 气象报告 + {VIEW_FUTURE_WEATHER, &NativeLauncher::InitFutureWeatherSlice}, // 未来天气 + {VIEW_GET_WEATHER_DATA_ERROR, &NativeLauncher::InitGetWeatherDataErrorSlice}, // 获取天气数据失败 + {VIEW_SYSTEM, &NativeLauncher::InitSystemSlice}, // 系统实例化地址 + {VIEW_SYSTEM_ABOUT_WATCH, &NativeLauncher::InitSystemAboutWatchSlice}, // 系统:关于手表实例化地址 + {VIEW_SYSTEM_SUPERVISE, &NativeLauncher::InitSystemSuperviseSlice}, // 系统:监管实例化地址 + {VIEW_SYSTEM_SYSTEM_LANGUAGE, &NativeLauncher::InitSystemLanguageSlice}, // 系统:系统语言实例化地址 + {VIEW_SYSTEM_REBOOT, &NativeLauncher::InitSystemRebootSlice}, // 系统:重启实例化地址 + {VIEW_SYSTEM_SHOUTDOWN, &NativeLauncher::InitSystemShoutDownSlice}, // 系统:关机实例化地址 + {VIEW_SYSTEM_FACTORY_RESET, &NativeLauncher::InitSystemFactoryResetSlice}, // 系统:恢复出厂设置实例化地址 //{VIEW_MAIN_ACTIVITY, &NativeLauncher::InitActivitySlice}, //{VIEW_OFFLINEVOICE, &NativeLauncher::InitOfflineVoice}, //{VIEW_MAIN_TEMP, &NativeLauncher::InitMainTempSlice}, //{VIEW_UISAMPLE, &NativeLauncher::InitUISampleSlice} - }; + }; static const ViewIdToString VIEW_MAPPER[] = { {VIEW_MAIN, "mainView"}, @@ -127,7 +149,7 @@ namespace OHOS {VIEW_CONNECT_PHONE, "ConnectPhoneView"}, {VIEW_INDOORWALK, "IndoorWalkView"}, {VIEW_SHUTDOWN_OR_REBOOT, "RebootView"}}; - + NativeLauncher::NativeLauncher() {} NativeLauncher::~NativeLauncher() {} @@ -430,4 +452,69 @@ namespace OHOS NativeAbility::GetInstance().AddSliceProxy(VIEW_GET_WEATHER_DATA_ERROR, getweatherdataerror); } + void NativeLauncher::InitSystemSlice(void) // 系统 + { + SliceProxy *system = new AbilitySliceProxy; + if (system == nullptr) + { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM, system); + } + void NativeLauncher::InitSystemAboutWatchSlice(void) // 系统:关于手表 + { + SliceProxy *systemaboutwatch = new AbilitySliceProxy; + if (systemaboutwatch == nullptr) + { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_ABOUT_WATCH, systemaboutwatch); + } + + void NativeLauncher::InitSystemSuperviseSlice(void) // 系统:监管 + { + SliceProxy *systemsupervise = new AbilitySliceProxy; + if (systemsupervise == nullptr) + { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_SUPERVISE, systemsupervise); + } + + void NativeLauncher::InitSystemLanguageSlice(void) // 系统:系统语言 + { + SliceProxy *systemlanguage = new AbilitySliceProxy; + if (systemlanguage == nullptr) + { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_SYSTEM_LANGUAGE, systemlanguage); + } + void NativeLauncher::InitSystemRebootSlice(void) // 系统:重新启动 + { + SliceProxy *systemreboot = new AbilitySliceProxy; + if (systemreboot == nullptr) + { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_REBOOT, systemreboot); + } + void NativeLauncher::InitSystemShoutDownSlice(void) // 系统:关机 + { + SliceProxy *systemshoutdown = new AbilitySliceProxy; + if (systemshoutdown == nullptr) + { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_SHOUTDOWN, systemshoutdown); + } + void NativeLauncher::InitSystemFactoryResetSlice(void) // 系统:恢复出厂设置 + { + SliceProxy *systemfactoryreset = new AbilitySliceProxy; + if (systemfactoryreset == nullptr) + { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_SYSTEM_FACTORY_RESET, systemfactoryreset); + } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodView.cpp index 74a23607b..34b69c663 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodView.cpp @@ -25,13 +25,14 @@ namespace OHOS BloodView::BloodView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodView::BloodView"); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); g_pBloodView = this; } BloodView::~BloodView() { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodView::~BloodView()"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodView::~BloodView"); RemoveAll(); DeInit(); g_pBloodView = nullptr; @@ -242,7 +243,6 @@ namespace OHOS } void BloodView::PreLoad(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "void BloodView::PreLoad(void)"); if (!viewiInitStatus) { InitView(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp index 4559f8a9c..2651ea9b7 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/src/CompassControlView.cpp @@ -6,6 +6,7 @@ */ #include "CompassControlView.h" #include "CompassModel.h" +#include "wearable_log.h" namespace OHOS { CompassControlView::CompassControlView() @@ -69,7 +70,6 @@ bool CompassControlView::InitView(void) void CompassControlView::PreLoad(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "void CompassControlView::PreLoad(void)"); if (!viewiInitStatus) { InitView(); viewiInitStatus = true; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp index 85936f96d..80a8d1167 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp @@ -101,11 +101,13 @@ namespace OHOS static Digital_clockView *g_pDigital_clockView{nullptr}; Digital_clockView::Digital_clockView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Digital_clockView::Digital_clockView"); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); g_pDigital_clockView = this; } Digital_clockView::~Digital_clockView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Digital_clockView::~Digital_clockView"); RemoveAll(); DeInit(); g_pDigital_clockView = nullptr; @@ -798,7 +800,6 @@ namespace OHOS */ void Digital_clockView::PreLoad(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " void Digital_clockView::PreLoad(void)"); if (!viewiInitStatus) { InitView(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h index 2d4a462cd..25af5b8b8 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainViewSample.h @@ -20,7 +20,7 @@ #include "ModelListenerSample.h" #include "ScreenModels.h" #include "ActivityWeekView.h" -#include "CompassControlView.h" +#include "compass/include/CompassControlView.h" #include "MainClockView.h" #include "PlayersView.h" #include "MainPresenterSample.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp index b19bcc4ae..411c6eccf 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp @@ -54,6 +54,7 @@ namespace OHOS recordCard[i] = nullptr; pageStatus[i] = false; } + mainSwipeGroup->RemoveAll(); /* -------------------------------------------------------------------------- */ #if 0 UIView *view = static_cast(MainViewSample::mainSwipeGroup)->GetChildrenHead(); @@ -111,7 +112,7 @@ namespace OHOS /* -------------------------------------------------------------------------- */ if (mainClockView != nullptr) { - mainClockView->RemoveAll(); + //mainClockView->RemoveAll(); delete mainClockView; mainClockView = nullptr; } @@ -122,13 +123,13 @@ namespace OHOS } if (bloodView != nullptr) { - bloodView->RemoveAll(); + //bloodView->RemoveAll(); delete bloodView; bloodView = nullptr; } if (traingView != nullptr) { - traingView->RemoveAll(); + //traingView->RemoveAll(); delete traingView; traingView = nullptr; } @@ -346,7 +347,7 @@ namespace OHOS } return playersView; } - + //主界面指南针卡片 UICardPage *MainViewSample::InitCompassPage(void) { compassControlView = new CompassControlView(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp index 76cdd0058..73d0eb79c 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/player/src/PlayersView.cpp @@ -827,7 +827,6 @@ bool PlayersView::InitView(void) void PlayersView::PreLoad(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PlayersView::PreLoad(void)"); if (!viewiInitStatus) { if (InitView()) { viewiInitStatus = true; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp index 4f2137449..ee54b7294 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/src/SettingModel.cpp @@ -29,9 +29,9 @@ namespace OHOS settings[4] = {SETTING_ITEM_FOUR, PNG_SETTINGS_SYSTEM, "系统", true}; settingIdToViewId.insert(std::pair(SETTING_ITEM_ZERO, VIEW_SHUTDOWN_OR_REBOOT)); settingIdToViewId.insert(std::pair(SETTING_ITEM_ONE, VIEW_BLUETOOTH_EARPHONE)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_TWO, VIEW_SHUTDOWN_OR_REBOOT)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_THREE, VIEW_SHUTDOWN_OR_REBOOT)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_FOUR, VIEW_SHUTDOWN_OR_REBOOT)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_TWO, VIEW_SYSTEM)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_THREE, VIEW_SYSTEM)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_FOUR, VIEW_SYSTEM)); } const SettingItem *SettingModel::GetSettinglistItems() const diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemAboutPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemAboutPresenter.h new file mode 100644 index 000000000..4938e2846 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemAboutPresenter.h @@ -0,0 +1,35 @@ +#ifndef SYSTEM_ABOUT_PRESENTER_H +#define SYSTEM_ABOUT_PRESENTER_H + +#include "Presenter.h" + +#include "SystemAboutView.h" + +namespace OHOS +{ + class SystemAboutView; + + class SystemAboutPresenter : public Presenter, + public UIView::OnClickListener, + public UIView::OnDragListener + { + public: + SystemAboutPresenter(); + virtual ~SystemAboutPresenter(); + + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + + static SystemAboutPresenter *GetInstance(); + + private: + //因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承; + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + }; +} //namespace OHOS + + +#endif //SLEEPDETAIL_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemAboutView.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemAboutView.h new file mode 100644 index 000000000..6a6812338 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemAboutView.h @@ -0,0 +1,53 @@ +#ifndef SYSTEM_ABOUT_VIEW_H +#define SYSTEM_ABOUT_VIEW_H + +#include "BaseView.h" +#include "View.h" +#include "components/ui_view_group.h" +#include "components/ui_scroll_view.h" +#include "components/ui_label.h" +#include "components/ui_image_view.h" +namespace OHOS +{ + class SystemAboutPresenter; + class SystemAboutView : public View + { + + public: + SystemAboutView(); + virtual ~SystemAboutView(); + static SystemAboutView *GetInstance(void); + + UILabel *InitLabel(int left, int top, int width, int height, const char *text, const char *viewId, int fontSize, int fontlineHeigh, uint16_t speed); + + public: + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + void SystemAboutInitIView(void); + void DeSystemAboutInitIView(void); + + private: + UIViewGroup *container_ = nullptr; + UIScrollView *scrollView1_ = nullptr; + UILabel *label1_ = nullptr; + UILabel *label2_ = nullptr; + UILabel *label3_ = nullptr; + UILabel *label4_ = nullptr; + UILabel *label5_ = nullptr; + UILabel *label6_ = nullptr; + UILabel *label7_ = nullptr; + UILabel *label8_ = nullptr; + UILabel *label9_ = nullptr; + UILabel *label10_ = nullptr; + UILabel *label11_ = nullptr; + UILabel *label12_ = nullptr; + UILabel *label13_ = nullptr; + + UIImageView *image = nullptr; + }; +} // namespace OHOS +#endif // SLEEPDETAIL_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemFactoryResetPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemFactoryResetPresenter.h new file mode 100644 index 000000000..f23356dfc --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemFactoryResetPresenter.h @@ -0,0 +1,34 @@ +#ifndef SYSTEM_FACTORYRESET_PRESENTER_H +#define SYSTEM_FACTORYRESET_PRESENTER_H + +#include "Presenter.h" + +#include "SystemFactoryResetView.h" + +namespace OHOS +{ + class SystemFactoryResetView; + + class SystemFactoryResetPresenter : public Presenter, + public UIView::OnClickListener, + public UIView::OnDragListener + { + public: + SystemFactoryResetPresenter(); + virtual ~SystemFactoryResetPresenter(); + + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + + static SystemFactoryResetPresenter *GetInstance(); + + private: + // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承; + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + }; +} // namespace OHOS + +#endif // SLEEPDETAIL_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemFactoryResetView.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemFactoryResetView.h new file mode 100644 index 000000000..c8487005a --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemFactoryResetView.h @@ -0,0 +1,39 @@ +#ifndef SYSTEM_FACTORYRESET_VIEW_H +#define SYSTEM_FACTORYRESET_VIEW_H + +#include "BaseView.h" +#include "View.h" + +#include "components/ui_view_group.h" +#include "components/ui_image_view.h" +#include "components/ui_button.h" +namespace OHOS +{ + static const char *FACTORYRESET_CHECKON = "ShoutDownButtonCheckOn";//确认 + static const char *FACTORYRESET_CHECKOFF = "ShoutDownButtonCheckOff";//取消 + class SystemFactoryResetPresenter; + class SystemFactoryResetView : public View + { + + public: + SystemFactoryResetView(); + virtual ~SystemFactoryResetView(); + static SystemFactoryResetView *GetInstance(void); + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + + void InitView(void); + void DeInitView(void); + + UIViewGroup *container_ = nullptr; + UIImageView *FactoryResetImage = nullptr; + UIButton *FactoryResetButtonCheckOn = nullptr; + UIButton *FactoryResetButtonCheckOff = nullptr; + }; +} // namespace OHOS +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemLanguagePresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemLanguagePresenter.h new file mode 100644 index 000000000..f4406d4e7 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemLanguagePresenter.h @@ -0,0 +1,42 @@ +#ifndef SYSTEM_LANGUAGE_PRESENTER_H +#define SYSTEM_LANGUAGE_PRESENTER_H + +#include "Presenter.h" +#include "SystemLanguageView.h" +#include "components/ui_checkbox.h" +namespace OHOS +{ + class SystemLanguageView; + + class SystemLanguagePresenter : public Presenter, + public UIView::OnClickListener, + public UIView::OnDragListener + { + public: + SystemLanguagePresenter(); + SystemLanguagePresenter(UICheckBox *checkbox1, UICheckBox *checkbox2) : m_checkbox1(checkbox1), m_checkbox2(checkbox2) {} + virtual ~SystemLanguagePresenter(); + + void UpdateCheckBoxState(UICheckBox &checkbox, bool isSelected); + //void ToggleCheckBoxState(UICheckBox &checkbox); + + public: + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + + static SystemLanguagePresenter *GetInstance(); + + private: + // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承; + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + + private: + UICheckBox *m_checkbox1 = nullptr; + UICheckBox *m_checkbox2 = nullptr; + }; +} // namespace OHOS + +#endif // SLEEPDETAIL_PRESENTER_H \ 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 new file mode 100644 index 000000000..7e251b5cb --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemLanguageView.h @@ -0,0 +1,51 @@ +#ifndef SYSTEM_LANGUAGE_VIEW_H +#define SYSTEM_LANGUAGE_VIEW_H + +#include "BaseView.h" +#include "View.h" + +#include "components/ui_view_group.h" +#include "components/ui_scroll_view.h" +#include "components/ui_label.h" +#include "components/ui_checkbox.h" +#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 SystemLanguagePresenter; + class SystemLanguageView : public View + { + + public: + SystemLanguageView(); + virtual ~SystemLanguageView(); + static SystemLanguageView *GetInstance(void); + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + void InitView(void); + void DeInitView(void); + + void init(void); + + private: + UIViewGroup *container_ = nullptr; + UIScrollView *scrollView = nullptr; + UILabel *LanguageLabel = nullptr; + UIImageView *SimplifiedChineseImage = nullptr; + UICheckBox *SimplifiedChineseCheckBox = nullptr; + UIImageView *EnglishImage = nullptr; + UILabel *SimplifiedChineseLabel = nullptr; + UILabel *EnglishLabel = nullptr; + UICheckBox *EnglishCheckBox = nullptr; + }; +} // namespace OHOS +#endif // SLEEPDETAIL_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemPresenter.h new file mode 100644 index 000000000..2a84cd2ed --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemPresenter.h @@ -0,0 +1,40 @@ +#ifndef SYSTEM_PRESENTER_H +#define SYSTEM_PRESENTER_H + +#include "Presenter.h" + +#include "SystemView.h" + +namespace OHOS +{ + class SystemView; + + class SystemPresenter : public Presenter, + 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; + }; +} //namespace OHOS + + + + + + + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemRebootPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemRebootPresenter.h new file mode 100644 index 000000000..9970612bb --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemRebootPresenter.h @@ -0,0 +1,34 @@ +#ifndef SYSTEM_REBOOT_PRESENTER_H +#define SYSTEM_REBOOT_PRESENTER_H + +#include "Presenter.h" + +#include "SystemRebootView.h" + +namespace OHOS +{ + class SystemRebootView; + + class SystemRebootPresenter : public Presenter, + public UIView::OnClickListener, + public UIView::OnDragListener + { + public: + SystemRebootPresenter(); + virtual ~SystemRebootPresenter(); + + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + + static SystemRebootPresenter *GetInstance(); + + private: + // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承; + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + }; +} // namespace OHOS + +#endif // SLEEPDETAIL_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemRebootView.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemRebootView.h new file mode 100644 index 000000000..5b25a8807 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemRebootView.h @@ -0,0 +1,39 @@ +#ifndef SYSTEM_REBOOT_VIEW_H +#define SYSTEM_REBOOT_VIEW_H + +#include "BaseView.h" +#include "View.h" + +#include "components/ui_view_group.h" +#include "components/ui_image_view.h" +#include "components/ui_button.h" +namespace OHOS +{ + static const char *REBOOT_CHECKON = "ShoutDownButtonCheckOn";//确认 + static const char *REBOOT_CHECKOFF = "ShoutDownButtonCheckOff";//取消 + class SystemRebootPresenter; + class SystemRebootView : public View + { + + public: + SystemRebootView(); + virtual ~SystemRebootView(); + static SystemRebootView *GetInstance(void); + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + + void InitView(void); + void DeInitView(void); + + UIViewGroup *container_ = nullptr; + UIImageView *RebootImage = nullptr; + UIButton *RebootButtonCheckOn = nullptr; + UIButton *RebootButtonCheckOff = nullptr; + }; +} // namespace OHOS +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemShoutDownPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemShoutDownPresenter.h new file mode 100644 index 000000000..c18289e79 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemShoutDownPresenter.h @@ -0,0 +1,34 @@ +#ifndef SYSTEM_SHOUTDOWN_PRESENTER_H +#define SYSTEM_SHOUTDOWN_PRESENTER_H + +#include "Presenter.h" + +#include "SystemShoutDownView.h" + +namespace OHOS +{ + class SystemShoutDownView; + + class SystemShoutDownPresenter : public Presenter, + public UIView::OnClickListener, + public UIView::OnDragListener + { + public: + SystemShoutDownPresenter(); + virtual ~SystemShoutDownPresenter(); + + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + + static SystemShoutDownPresenter *GetInstance(); + + private: + // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承; + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + }; +} // namespace OHOS + +#endif // SLEEPDETAIL_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemShoutDownView.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemShoutDownView.h new file mode 100644 index 000000000..d36151317 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemShoutDownView.h @@ -0,0 +1,39 @@ +#ifndef SYSTEM_SHOUTDOWN_VIEW_H +#define SYSTEM_SHOUTDOWN_VIEW_H + +#include "BaseView.h" +#include "View.h" + +#include "components/ui_view_group.h" +#include "components/ui_image_view.h" +#include "components/ui_button.h" +namespace OHOS +{ + static const char *SHOUTDOWN_BUTTON_CHECKON = "ShoutDownButtonCheckOn";//确认 + static const char *SHOUTDOWN_BUTTON_CHECKOFF = "ShoutDownButtonCheckOff";//取消 + class SystemShoutDownPresenter; + class SystemShoutDownView : public View + { + + public: + SystemShoutDownView(); + virtual ~SystemShoutDownView(); + static SystemShoutDownView *GetInstance(void); + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + + void InitView(void); + void DeInitView(void); + + UIViewGroup *container_ = nullptr; + UIImageView *ShoutDownImage = nullptr; + UIButton *ShoutDownButtonCheckOn = nullptr; + UIButton *ShoutDownButtonCheckOff = nullptr; + }; +} // namespace OHOS +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemSupervisePresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemSupervisePresenter.h new file mode 100644 index 000000000..df8183ce7 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemSupervisePresenter.h @@ -0,0 +1,34 @@ +#ifndef SYSTEM_SUPERVISE_PRESENTER_H +#define SYSTEM_SUPERVISE_PRESENTER_H + +#include "Presenter.h" + +#include "SystemSuperviseView.h" + +namespace OHOS +{ + class SystemSuperviseView; + + class SystemSupervisePresenter : public Presenter, + public UIView::OnClickListener, + public UIView::OnDragListener + { + public: + SystemSupervisePresenter(); + virtual ~SystemSupervisePresenter(); + + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + + static SystemSupervisePresenter *GetInstance(); + + private: + // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承; + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + }; +} // namespace OHOS + +#endif // SLEEPDETAIL_PRESENTER_H \ 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 new file mode 100644 index 000000000..ba426fbe2 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemSuperviseView.h @@ -0,0 +1,40 @@ +#ifndef SYSTEM_SUPERVISE_VIEW_H +#define SYSTEM_SUPERVISE_VIEW_H + +#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 +{ + class SystemSupervisePresenter; + class SystemSuperviseView : public View + { + + public: + SystemSuperviseView(); + virtual ~SystemSuperviseView(); + static SystemSuperviseView *GetInstance(void); + UILabel *InitLabel(int left, int top, int width, int height, const char *text, const char *viewId, int fontSize, int fontlineHeigh, uint16_t speed); + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + void InitView(void); + void DeInitView(void); + + private: + UIViewGroup *container_ = nullptr; + UIScrollView *scrollView1_ = nullptr; + UILabel *label1_ = nullptr; + UILabel *label2_ = nullptr; + UILabel *label3_ = nullptr; + UILabel *label4_ = nullptr; + UILabel *label5_ = nullptr; + }; +} // namespace OHOS +#endif // SLEEPDETAIL_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemView.h b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemView.h new file mode 100644 index 000000000..a135aec23 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/include/SystemView.h @@ -0,0 +1,56 @@ +#ifndef SYSTEM_VIEW_H +#define SYSTEM_VIEW_H + +#include "BaseView.h" +#include "View.h" + +#include "components/ui_view_group.h" +#include "components/ui_scroll_view.h" +#include "components/ui_label.h" +#include "components/ui_image_view.h" +#include "components/ui_button.h" + +namespace OHOS +{ + static const char *ABOUT_THE_WATCH = "AboutTheWatchButton"; // 关于手表 + static const char *SUPERVISE = "SuperviseButton"; // 监管 + static const char *SYSTEM_LANGUAGE = "SystemLanguageButton"; // 系统语言 + static const char *REBOOT = "RebootButton"; // 重启 + static const char *SHOUTDOWM = "ShoutdownButton"; // 关机 + static const char *FACTORY_RESET = "FactoryResetButton"; // 恢复出厂设置 + class SystemPresenter; + class SystemView : public View + { + + public: + SystemView(); + virtual ~SystemView(); + static SystemView *GetInstance(void); + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + UIView::OnDragListener *draglistener{nullptr}; + + void InitIView(void); + void DeInitView(void); + + private: + UIViewGroup *container_ = nullptr; + UIScrollView *SystemScrollView = nullptr; + UILabel *SystemLabel = nullptr; + UIImageView *image2_ = nullptr; + UIImageView *image1_ = nullptr; + UIButton *FactoryResetButton = nullptr; + UIButton *ShoutdownButton = nullptr; + UIButton *RebootButton = nullptr; + UIButton *AboutTheWatchButton = nullptr; + UIButton *SuperviseButton = nullptr; + UIButton *SystemLanguageButton = nullptr; + }; +} // namespace OHOS + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemAboutPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemAboutPresenter.cpp new file mode 100644 index 000000000..c302d4c40 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemAboutPresenter.cpp @@ -0,0 +1,73 @@ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "graphic_math.h" +#include "string.h" +#include "system/include/SystemAboutPresenter.h" +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static SystemAboutPresenter *g_pSystemAboutPresenter = nullptr; + + SystemAboutPresenter::SystemAboutPresenter() + { + + g_pSystemAboutPresenter = this; + } + + SystemAboutPresenter::~SystemAboutPresenter() + { + + g_pSystemAboutPresenter = nullptr; + } + + SystemAboutPresenter *SystemAboutPresenter::GetInstance() + { + + return g_pSystemAboutPresenter; + } + + void SystemAboutPresenter::OnStart() + { + + Presenter::OnStart(); + } + + void SystemAboutPresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void SystemAboutPresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void SystemAboutPresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool SystemAboutPresenter::OnDrag(UIView &view, const DragEvent &event) + { + + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && + (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM); + return true; + } + return false; + } + + bool SystemAboutPresenter::OnClick(UIView &view, const ClickEvent &event) + { + + // 根据控件id查找是哪个控件触发了点击回调 + // if (strcmp(view.GetViewId(), 控件ID) == 0) + return true; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemAboutView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemAboutView.cpp new file mode 100644 index 000000000..514016d4d --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemAboutView.cpp @@ -0,0 +1,299 @@ +#include "system/include/SystemAboutView.h" +#include "system/include/SystemAboutPresenter.h" +#include "UiConfig.h" + +namespace OHOS +{ + + static SystemAboutView *g_pSystemAboutView{nullptr}; + + SystemAboutView::SystemAboutView() + { + + g_pSystemAboutView = this; + } + + SystemAboutView::~SystemAboutView() + { + + g_pSystemAboutView = nullptr; + } + + SystemAboutView *SystemAboutView::GetInstance() + { + + return g_pSystemAboutView; + } + UILabel *SystemAboutView::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(); + label->SetPosition(left, top); // 位置 + label->Resize(width, height); // 大小 + label->SetViewId(viewId); // id + label->SetStyle(STYLE_TEXT_FONT, fontSize); // 字体大小 + label->SetStyle(STYLE_LINE_HEIGHT, fontlineHeigh); // 字体行高 + label->SetText(text); // 内容 + label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label->SetRollSpeed(speed); + label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, fontSize); + + return label; + } + + void SystemAboutView::SystemAboutInitIView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + UIView::OnDragListener *draglistener = static_cast(SystemAboutPresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + container_->SetTouchable(true); + container_->SetDraggable(true); + } + + if (scrollView1_ == nullptr) + { + scrollView1_ = new UIScrollView(); + } + scrollView1_->SetPosition(0, 0); + scrollView1_->Resize(466, 466); + scrollView1_->SetViewId("scrollView"); + scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + scrollView1_->SetStyle(STYLE_BORDER_RADIUS, 1294); + container_->Add(scrollView1_); + scrollView1_->SetVisible(true); + /***********************************************************************************************************/ + if (label1_ == nullptr) + { + label1_ = InitLabel(203, 52, 60, 35, "关于", "label1", 30, 35, 6); + } + scrollView1_->Add(label1_); + label1_->SetVisible(true); + /***********************************************************************************************************/ + if (label2_ == nullptr) + { + label2_ = InitLabel(173, 160, 120, 35, "手表名称", "label2", 30, 35, 6); + } + scrollView1_->Add(label2_); + label2_->SetVisible(true); + /***********************************************************************************************************/ + if (label3_ == nullptr) + { + label3_ = InitLabel(97, 217, 263, 30, "周冰鸿的 Smart Watch", "label3", 26, 30, 6); + } + label3_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); + scrollView1_->Add(label3_); + label3_->SetVisible(true); + /***********************************************************************************************************/ + // Add Label to App + if (label4_ == nullptr) + { + label4_ = InitLabel(173, 305, 120, 35, "固件版本", "label4", 30, 35, 6); + } + scrollView1_->Add(label4_); + label4_->SetVisible(true); + /***********************************************************************************************************/ + // Add Label to App + if (label5_ == nullptr) + { + label5_ = InitLabel(174, 361, 119, 30, "V02.03.01", "label5", 26, 30, 6); + } + label5_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); + scrollView1_->Add(label5_); + label5_->SetVisible(true); + /***********************************************************************************************************/ + if (label6_ == nullptr) + { + label6_ = InitLabel(173, 450, 120, 35, "算法版本", "label6", 30, 35, 6); + } + scrollView1_->Add(label6_); + label6_->SetVisible(true); + RootView::GetInstance()->Add(container_); + /***********************************************************************************************************/ + if (label7_ == nullptr) + { + label7_ = InitLabel(131, 506, 204, 30, "V02.03.01 OTA88", "label7", 26, 30, 6); + } + label7_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); + scrollView1_->Add(label7_); + label7_->SetVisible(true); + /***********************************************************************************************************/ + if (label8_ == nullptr) + { + label8_ = InitLabel(173, 595, 120, 35, "蓝牙地址", "label8", 30, 35, 6); + } + + scrollView1_->Add(label8_); + label8_->SetVisible(true); + /***********************************************************************************************************/ + if (label9_ == nullptr) + { + label9_ = InitLabel(123, 651, 220, 30, "D4:FF:E3:12:00:A4", "label9", 26, 30, 6); + } + + label9_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); + scrollView1_->Add(label9_); + label9_->SetVisible(true); + /***********************************************************************************************************/ + if (label10_ == nullptr) + { + label10_ = InitLabel(158, 740, 120, 35, "局域网地址", "label10", 30, 35, 6); + } + scrollView1_->Add(label10_); + label10_->SetVisible(true); + /***********************************************************************************************************/ + if (label11_ == nullptr) + { + label11_ = InitLabel(123, 796, 220, 30, "D4:FF:E3:12:00:A4", "label11", 26, 30, 6); + } + label11_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); + scrollView1_->Add(label11_); + label11_->SetVisible(true); + /***********************************************************************************************************/ + if (label12_ == nullptr) + { + label12_ = InitLabel(185, 885, 97, 35, "FONTS", "label12", 30, 35, 6); + } + scrollView1_->Add(label12_); + label12_->SetVisible(true); + /***********************************************************************************************************/ + if (label13_ == nullptr) + { + label13_ = InitLabel(130, 941, 207, 30, "HarmonyOS Sans", "label13", 26, 30, 6); + } + label13_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); + scrollView1_->Add(label13_); + label13_->SetVisible(true); + /***********************************************************************************************************/ + // Add ImageView to App + if (image == nullptr) + { + image = new UIImageView(); + } + image->SetPosition(183, 941); + image->Resize(100, 100); + image->SetViewId("image"); + + scrollView1_->Add(image); + image->SetVisible(true); + } + void SystemAboutView::DeSystemAboutInitIView() + { + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + if (scrollView1_ != nullptr) + { + delete scrollView1_; + scrollView1_ = nullptr; + } + if (label1_ != nullptr) + { + delete label1_; + label1_ = nullptr; + } + if (label2_ != nullptr) + { + delete label2_; + label2_ = nullptr; + } + if (label3_ != nullptr) + { + delete label3_; + label3_ = nullptr; + } + if (label4_ != nullptr) + { + delete label4_; + label4_ = nullptr; + } + if (label5_ != nullptr) + { + delete label5_; + label5_ = nullptr; + } + if (label6_ != nullptr) + { + delete label6_; + label6_ = nullptr; + } + if (label7_ != nullptr) + { + delete label7_; + label7_ = nullptr; + } + if (label8_ != nullptr) + { + delete label8_; + label8_ = nullptr; + } + if (label9_ != nullptr) + { + delete label9_; + label9_ = nullptr; + } + if (label10_ != nullptr) + { + delete label10_; + label10_ = nullptr; + } + if (label11_ != nullptr) + { + delete label11_; + label11_ = nullptr; + } + if (label12_ != nullptr) + { + delete label12_; + label12_ = nullptr; + } + if (label13_ != nullptr) + { + delete label13_; + label13_ = nullptr; + } + if (image != nullptr) + { + delete image; + image = nullptr; + } + } + + void SystemAboutView::OnStart() + { + SystemAboutInitIView(); + RootView::GetInstance()->Add(container_); + } + + void SystemAboutView::OnSetUpView() + { + + View::OnSetUpView(); + Draw(); + } + + void SystemAboutView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void SystemAboutView::OnStop() + { + + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} \ 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 new file mode 100644 index 000000000..1f49d3673 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemFactoryResetPresenter.cpp @@ -0,0 +1,79 @@ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "graphic_math.h" +#include "string.h" +#include "system/include/SystemFactoryResetPresenter.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static SystemFactoryResetPresenter *g_pSystemFactoryResetPresenter = nullptr; + + SystemFactoryResetPresenter::SystemFactoryResetPresenter() + { + + g_pSystemFactoryResetPresenter = this; + } + + SystemFactoryResetPresenter::~SystemFactoryResetPresenter() + { + + g_pSystemFactoryResetPresenter = nullptr; + } + + SystemFactoryResetPresenter *SystemFactoryResetPresenter::GetInstance() + { + + return g_pSystemFactoryResetPresenter; + } + + void SystemFactoryResetPresenter::OnStart() + { + + Presenter::OnStart(); + } + + void SystemFactoryResetPresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void SystemFactoryResetPresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void SystemFactoryResetPresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool SystemFactoryResetPresenter::OnDrag(UIView &view, const DragEvent &event) + { + + UNUSED(view); + UNUSED(event); + return true; + } + + bool SystemFactoryResetPresenter::OnClick(UIView &view, const ClickEvent &event) + { + + // 根据控件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) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemFactoryResetView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemFactoryResetView.cpp new file mode 100644 index 000000000..b63e39e29 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemFactoryResetView.cpp @@ -0,0 +1,138 @@ +#include "system/include/SystemFactoryResetView.h" +#include "system/include/SystemFactoryResetPresenter.h" + +#include "UiConfig.h" + +namespace OHOS +{ + + static SystemFactoryResetView *g_pSystemFactoryResetView{nullptr}; + + SystemFactoryResetView::SystemFactoryResetView() + { + g_pSystemFactoryResetView = this; + } + + SystemFactoryResetView::~SystemFactoryResetView() + { + DeInitView(); + g_pSystemFactoryResetView = nullptr; + } + + SystemFactoryResetView *SystemFactoryResetView::GetInstance() + { + return g_pSystemFactoryResetView; + } + + void SystemFactoryResetView::InitView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + } + // Add ImageView to App + if (FactoryResetImage == nullptr) + { + FactoryResetImage = new UIImageView(); + } + FactoryResetImage->SetPosition(0, 0); // widget's left position and top position + FactoryResetImage->Resize(466, 466); // widget's width and height + FactoryResetImage->SetViewId("FactoryResetImage"); // Set style + FactoryResetImage->SetStyle(STYLE_BORDER_RADIUS, 300); + FactoryResetImage->SetSrc("/user/res/system/factoryreset.bin"); //恢复出厂设置 + // Add to rootView + container_->Add(FactoryResetImage); + FactoryResetImage->SetVisible(true); + + // Add Button to App + if (FactoryResetButtonCheckOn == nullptr) + { + FactoryResetButtonCheckOn = new UIButton(); + } + FactoryResetButtonCheckOn->SetPosition(256, 336); // widget's left position and top position + FactoryResetButtonCheckOn->Resize(100, 100); // widget's width and height + FactoryResetButtonCheckOn->SetViewId(FACTORYRESET_CHECKON); // Set style + FactoryResetButtonCheckOn->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + FactoryResetButtonCheckOn->SetImageSrc(PNG_SYSTEM_CHECK_ON_IMAGE, nullptr); + FactoryResetButtonCheckOn->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED); + FactoryResetButtonCheckOn->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + // Add the CallBack about events + UIView::OnClickListener *FactoryResetButtonCheckOnClick = static_cast(SystemFactoryResetPresenter::GetInstance()); + FactoryResetButtonCheckOn->SetOnClickListener(FactoryResetButtonCheckOnClick); + // Add to rootView + container_->Add(FactoryResetButtonCheckOn); + FactoryResetButtonCheckOn->SetVisible(true); + + // Add Button to App + if (FactoryResetButtonCheckOff == nullptr) + { + FactoryResetButtonCheckOff = new UIButton(); + } + FactoryResetButtonCheckOff->SetPosition(111, 336); // widget's left position and top position + FactoryResetButtonCheckOff->Resize(100, 100); // widget's width and height + FactoryResetButtonCheckOff->SetViewId(FACTORYRESET_CHECKOFF); // Set style + FactoryResetButtonCheckOff->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + FactoryResetButtonCheckOff->SetImageSrc(PNG_SYSTEM_CHECK_OFF_IMAGE, nullptr); + FactoryResetButtonCheckOff->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED); + FactoryResetButtonCheckOff->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + // Add the CallBack about events + UIView::OnClickListener *FactoryResetButtonCheckOffClick = static_cast(SystemFactoryResetPresenter::GetInstance()); + FactoryResetButtonCheckOff->SetOnClickListener(FactoryResetButtonCheckOffClick); + // Add to rootView + container_->Add(FactoryResetButtonCheckOff); + FactoryResetButtonCheckOff->SetVisible(true); + } + + void SystemFactoryResetView::DeInitView() + { + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + if (FactoryResetImage != nullptr) + { + delete FactoryResetImage; + FactoryResetImage = nullptr; + } + if (FactoryResetButtonCheckOn != nullptr) + { + delete FactoryResetButtonCheckOn; + FactoryResetButtonCheckOn = nullptr; + } + if (FactoryResetButtonCheckOff != nullptr) + { + delete FactoryResetButtonCheckOff; + FactoryResetButtonCheckOff = nullptr; + } + } + + void SystemFactoryResetView::OnStart() + { + View::OnStart(); + InitView(); + RootView::GetInstance()->Add(container_); + } + + void SystemFactoryResetView::OnSetUpView() + { + View::OnSetUpView(); + Draw(); + } + + void SystemFactoryResetView::OnTearDownView() + { + View::OnTearDownView(); + return; + } + + void SystemFactoryResetView::OnStop() + { + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemLanguagePresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemLanguagePresenter.cpp new file mode 100644 index 000000000..7fb76a69a --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemLanguagePresenter.cpp @@ -0,0 +1,90 @@ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "graphic_math.h" +#include "string.h" +#include "system/include/SystemLanguagePresenter.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static SystemLanguagePresenter *g_pSystemLanguagePresenter = nullptr; + int count = 1; + SystemLanguagePresenter::SystemLanguagePresenter() + { + + g_pSystemLanguagePresenter = this; + } + + SystemLanguagePresenter::~SystemLanguagePresenter() + { + + g_pSystemLanguagePresenter = nullptr; + } + + SystemLanguagePresenter *SystemLanguagePresenter::GetInstance() + { + + return g_pSystemLanguagePresenter; + } + + void SystemLanguagePresenter::OnStart() + { + + Presenter::OnStart(); + } + + void SystemLanguagePresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void SystemLanguagePresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void SystemLanguagePresenter::OnStop(void) + { + + Presenter::OnStop(); + } + bool SystemLanguagePresenter::OnDrag(UIView &view, const DragEvent &event) + { + UNUSED(view); + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && + (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM); + return true; + } + return false; + } + + bool SystemLanguagePresenter::OnClick(UIView &view, const ClickEvent &event) + { + if (strcmp(view.GetViewId(), SIMPLIFIED_CHINESE_CHECKBOX) == 0) + { + + m_checkbox1->SetState(UICheckBox::SELECTED); + UpdateCheckBoxState(*m_checkbox2, false); + + return true; + } + else if (strcmp(view.GetViewId(), ENGLISH_CHECKBOX) == 0) + { + m_checkbox2->SetState(UICheckBox::SELECTED); + UpdateCheckBoxState(*m_checkbox1, false); + return true; + } + return false; + } + + // 根据传入的选中状态更新复选框的状态 + void SystemLanguagePresenter::UpdateCheckBoxState(UICheckBox &checkbox, bool isSelected) + { + checkbox.SetState(isSelected ? UICheckBox::SELECTED : UICheckBox::UNSELECTED); + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemLanguageView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemLanguageView.cpp new file mode 100644 index 000000000..035f37761 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemLanguageView.cpp @@ -0,0 +1,270 @@ +#include "system/include/SystemLanguageView.h" +#include "system/include/SystemLanguagePresenter.h" +#include "string.h" +#include "UiConfig.h" +#include "ui_view.h" +namespace OHOS +{ + + static SystemLanguageView *g_pSystemLanguageView{nullptr}; + + SystemLanguageView::SystemLanguageView() + { + + g_pSystemLanguageView = this; + } + + SystemLanguageView::~SystemLanguageView() + { + DeInitView(); + g_pSystemLanguageView = nullptr; + } + + SystemLanguageView *SystemLanguageView::GetInstance() + { + + return g_pSystemLanguageView; + } + + void SystemLanguageView::InitView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + UIView::OnDragListener *draglistener = static_cast(SystemLanguagePresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + container_->SetTouchable(true); + container_->SetDraggable(true); + } + /***********************************************************************************************************/ + if (scrollView == nullptr) + { + scrollView = new UIScrollView(); + } + scrollView->SetPosition(0, 0); + scrollView->Resize(466, 466); + scrollView->SetViewId("scrollView"); + scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + scrollView->SetStyle(STYLE_BORDER_RADIUS, 1294); + container_->Add(scrollView); + scrollView->SetVisible(true); + /***********************************************************************************************************/ + // Add Label to App + if (LanguageLabel == nullptr) + { + LanguageLabel = new UILabel(); + } + LanguageLabel->SetPosition(203, 52); // widget's left position and top position + LanguageLabel->Resize(200, 60); // widget's width and height + LanguageLabel->SetViewId("LanguageLabel"); // Set style + LanguageLabel->SetStyle(STYLE_TEXT_FONT, 30); + LanguageLabel->SetStyle(STYLE_LINE_HEIGHT, 35); + // Set additional property + LanguageLabel->SetText("语言"); + LanguageLabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + LanguageLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + LanguageLabel->SetRollSpeed(0); + LanguageLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + scrollView->Add(LanguageLabel); + LanguageLabel->SetVisible(true); + /***********************************************************************************************************/ + if (SimplifiedChineseImage == nullptr) + { + SimplifiedChineseImage = new UIImageView(); + } + SimplifiedChineseImage->SetPosition(43, 120); + SimplifiedChineseImage->Resize(380, 100); + SimplifiedChineseImage->SetViewId(SIMPLIFIED_CHINESE_BUTTON); + SimplifiedChineseImage->SetStyle(STYLE_BORDER_RADIUS, 50); + SimplifiedChineseImage->SetSrc(PNG_SETTING_BACKGROUND_IMAGE); + // Add to scrollView1 + scrollView->Add(SimplifiedChineseImage); + SimplifiedChineseImage->SetVisible(true); + /***********************************************************************************************************/ + if (SimplifiedChineseLabel == nullptr) + { + SimplifiedChineseLabel = new UILabel(); + } + SimplifiedChineseLabel->SetPosition(90, 153); + SimplifiedChineseLabel->Resize(120, 35); + SimplifiedChineseLabel->SetViewId("SimplifiedChineseLabel"); + SimplifiedChineseLabel->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + SimplifiedChineseLabel->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + SimplifiedChineseLabel->SetStyle(STYLE_TEXT_FONT, 30); + SimplifiedChineseLabel->SetStyle(STYLE_LINE_HEIGHT, 35); + // Set additional property + SimplifiedChineseLabel->SetText("简体中文"); + SimplifiedChineseLabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + SimplifiedChineseLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + SimplifiedChineseLabel->SetRollSpeed(0); + SimplifiedChineseLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + // Add to scrollView1 + scrollView->Add(SimplifiedChineseLabel); + SimplifiedChineseLabel->SetVisible(true); + /***********************************************************************************************************/ + // Add CheckBox to App + if (SimplifiedChineseCheckBox == nullptr) + { + SimplifiedChineseCheckBox = new UICheckBox(); + } + SimplifiedChineseCheckBox->SetState(UICheckBox::SELECTED); + SimplifiedChineseCheckBox->SetPosition(300, 130); // widget's left position and top position + SimplifiedChineseCheckBox->Resize(80, 80); // widget's width and height + SimplifiedChineseCheckBox->SetViewId(SIMPLIFIED_CHINESE_CHECKBOX); // Set style + SimplifiedChineseCheckBox->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + SimplifiedChineseCheckBox->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + SimplifiedChineseCheckBox->SetImages(PNG_CHECKBOX_ON_IMAGE, PNG_CHECKBOX_OFF_IMAGE); + // Add the CallBack about events + UIView::OnClickListener *SimplifiedChineseCheckBoxClick = static_cast(SystemLanguagePresenter::GetInstance()); + SimplifiedChineseCheckBox->SetOnClickListener(SimplifiedChineseCheckBoxClick); + // Add to scrollView1 + scrollView->Add(SimplifiedChineseCheckBox); + SimplifiedChineseCheckBox->SetVisible(true); + /***********************************************************************************************************/ + if (EnglishImage == nullptr) + { + EnglishImage = new UIImageView(); + } + EnglishImage->SetPosition(43, 240); + EnglishImage->Resize(380, 100); + EnglishImage->SetViewId(ENGLISH_BUTTON); + EnglishImage->SetStyle(STYLE_BORDER_RADIUS, 50); + EnglishImage->SetSrc(PNG_SETTING_BACKGROUND_IMAGE); + scrollView->Add(EnglishImage); + EnglishImage->SetVisible(true); + /***********************************************************************************************************/ + if (EnglishLabel == nullptr) + { + EnglishLabel = new UILabel(); + } + EnglishLabel->SetPosition(90, 273); // widget's left position and top position + EnglishLabel->Resize(126, 35); // widget's width and height + EnglishLabel->SetViewId("EnglishLabel"); // Set style + EnglishLabel->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + EnglishLabel->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + EnglishLabel->SetStyle(STYLE_TEXT_FONT, 30); + EnglishLabel->SetStyle(STYLE_LINE_HEIGHT, 35); + + // Set additional property + EnglishLabel->SetText("ENGLISH"); + EnglishLabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + EnglishLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + EnglishLabel->SetRollSpeed(0); + EnglishLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + + // Add to scrollView1 + scrollView->Add(EnglishLabel); + EnglishLabel->SetVisible(true); + + // Add CheckBox to App + if (EnglishCheckBox == nullptr) + { + EnglishCheckBox = new UICheckBox(); + } + EnglishCheckBox->SetPosition(300, 250); + EnglishCheckBox->Resize(80, 80); + EnglishCheckBox->SetViewId(ENGLISH_CHECKBOX); + EnglishCheckBox->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + EnglishCheckBox->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + EnglishCheckBox->SetImages(PNG_CHECKBOX_ON_IMAGE, PNG_CHECKBOX_OFF_IMAGE); + + // Add the CallBack about events + UIView::OnClickListener *EnglishCheckBoxClick = static_cast(SystemLanguagePresenter::GetInstance()); + EnglishCheckBox->SetOnClickListener(EnglishCheckBoxClick); + // Add to scrollView1 + scrollView->Add(EnglishCheckBox); + EnglishCheckBox->SetVisible(true); + + /***********************************************************************************************************/ + // Add the CallBack about SimplifiedChineseImage sevents + UIView::OnClickListener *ButtonClick = static_cast(new SystemLanguagePresenter(SimplifiedChineseCheckBox, EnglishCheckBox)); + SimplifiedChineseCheckBox->SetOnClickListener(ButtonClick); + EnglishCheckBox->SetOnClickListener(ButtonClick); + } + + void SystemLanguageView::DeInitView() + { + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + if (scrollView != nullptr) + { + delete scrollView; + scrollView = nullptr; + } + if (LanguageLabel != nullptr) + { + delete LanguageLabel; + LanguageLabel = nullptr; + } + if (SimplifiedChineseImage != nullptr) + { + delete SimplifiedChineseImage; + SimplifiedChineseImage = nullptr; + } + if (SimplifiedChineseCheckBox != nullptr) + { + delete SimplifiedChineseCheckBox; + SimplifiedChineseCheckBox = nullptr; + } + if (EnglishImage != nullptr) + { + delete EnglishImage; + EnglishImage = nullptr; + } + if (SimplifiedChineseLabel != nullptr) + { + delete SimplifiedChineseLabel; + SimplifiedChineseLabel = nullptr; + } + if (EnglishLabel != nullptr) + { + delete EnglishLabel; + EnglishLabel = nullptr; + } + if (EnglishCheckBox != nullptr) + { + delete EnglishCheckBox; + EnglishCheckBox = nullptr; + } + } + + void SystemLanguageView::OnStart() + { + View::OnStart(); + InitView(); + // container_容器属性 add + RootView::GetInstance()->Add(container_); + } + + void SystemLanguageView::OnSetUpView() + { + + View::OnSetUpView(); + Draw(); + } + + void SystemLanguageView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void SystemLanguageView::OnStop() + { + + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemPresenter.cpp new file mode 100644 index 000000000..db7203920 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemPresenter.cpp @@ -0,0 +1,102 @@ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "graphic_math.h" +#include "string.h" +#include "system/include/SystemPresenter.h" +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static SystemPresenter *g_pSystemPresenter = nullptr; + + SystemPresenter::SystemPresenter() + { + + g_pSystemPresenter = this; + } + + SystemPresenter::~SystemPresenter() + { + + g_pSystemPresenter = nullptr; + } + + SystemPresenter *SystemPresenter::GetInstance() + { + + return g_pSystemPresenter; + } + + void SystemPresenter::OnStart() + { + + Presenter::OnStart(); + } + + void SystemPresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void SystemPresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void SystemPresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool SystemPresenter::OnDrag(UIView &view, const DragEvent &event) + { + + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && + (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SETTING); + return true; + } + return false; + } + + bool SystemPresenter::OnClick(UIView &view, const ClickEvent &event) + { + + // 根据控件id查找是哪个控件触发了点击回调 + if (strcmp(view.GetViewId(), ABOUT_THE_WATCH) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM_ABOUT_WATCH); + return true; + } + else if (strcmp(view.GetViewId(), SUPERVISE) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM_SUPERVISE); + return true; + } + else if (strcmp(view.GetViewId(), SYSTEM_LANGUAGE) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM_SYSTEM_LANGUAGE); + return true; + } + else if (strcmp(view.GetViewId(), REBOOT) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM_REBOOT); + return true; + } + else if (strcmp(view.GetViewId(), SHOUTDOWM) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM_SHOUTDOWN); + return true; + } + else if (strcmp(view.GetViewId(), FACTORY_RESET) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM_FACTORY_RESET); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemRebootPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemRebootPresenter.cpp new file mode 100644 index 000000000..ffe00720b --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemRebootPresenter.cpp @@ -0,0 +1,83 @@ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "graphic_math.h" +#include "string.h" +#include "system/include/SystemRebootPresenter.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static SystemRebootPresenter *g_pSystemRebootPresenter = nullptr; + + SystemRebootPresenter::SystemRebootPresenter() + { + + g_pSystemRebootPresenter = this; + } + + SystemRebootPresenter::~SystemRebootPresenter() + { + + g_pSystemRebootPresenter = nullptr; + } + + SystemRebootPresenter *SystemRebootPresenter::GetInstance() + { + + return g_pSystemRebootPresenter; + } + + void SystemRebootPresenter::OnStart() + { + + Presenter::OnStart(); + } + + void SystemRebootPresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void SystemRebootPresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void SystemRebootPresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool SystemRebootPresenter::OnDrag(UIView &view, const DragEvent &event) + { + + UNUSED(view); + UNUSED(event); + return true; + } + extern "C" + { + //重启 + uint32_t mcu_os_sys_reset(uint8_t *para, uint32_t para_len); + } + bool SystemRebootPresenter::OnClick(UIView &view, const ClickEvent &event) + { + + // 根据控件id查找是哪个控件触发了点击回调 + if (strcmp(view.GetViewId(), REBOOT_CHECKON) == 0) + { + mcu_os_sys_reset(NULL,NULL); + return true; + } + else if (strcmp(view.GetViewId(), REBOOT_CHECKOFF) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemRebootView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemRebootView.cpp new file mode 100644 index 000000000..79e337fde --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemRebootView.cpp @@ -0,0 +1,138 @@ +#include "system/include/SystemRebootView.h" +#include "system/include/SystemRebootPresenter.h" + +#include "UiConfig.h" + +namespace OHOS +{ + + static SystemRebootView *g_pSystemRebootView{nullptr}; + + SystemRebootView::SystemRebootView() + { + g_pSystemRebootView = this; + } + + SystemRebootView::~SystemRebootView() + { + DeInitView(); + g_pSystemRebootView = nullptr; + } + + SystemRebootView *SystemRebootView::GetInstance() + { + return g_pSystemRebootView; + } + + void SystemRebootView::InitView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + } + // Add ImageView to App + if (RebootImage == nullptr) + { + RebootImage = new UIImageView(); + } + RebootImage->SetPosition(0, 0); // widget's left position and top position + RebootImage->Resize(466, 466); // widget's width and height + RebootImage->SetViewId("RebootImage"); // Set style + RebootImage->SetStyle(STYLE_BORDER_RADIUS, 300); + RebootImage->SetSrc("/user/res/system/reboot.bin"); //重新启动 + // Add to rootView + container_->Add(RebootImage); + RebootImage->SetVisible(true); + + // Add Button to App + if (RebootButtonCheckOn == nullptr) + { + RebootButtonCheckOn = new UIButton(); + } + RebootButtonCheckOn->SetPosition(256, 299); // widget's left position and top position + RebootButtonCheckOn->Resize(100, 100); // widget's width and height + RebootButtonCheckOn->SetViewId(REBOOT_CHECKON); // Set style + RebootButtonCheckOn->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + RebootButtonCheckOn->SetImageSrc(PNG_SYSTEM_CHECK_ON_IMAGE, nullptr); + RebootButtonCheckOn->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED); + RebootButtonCheckOn->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + // Add the CallBack about events + UIView::OnClickListener *RebootButtonCheckOnClick = static_cast(SystemRebootPresenter::GetInstance()); + RebootButtonCheckOn->SetOnClickListener(RebootButtonCheckOnClick); + // Add to rootView + container_->Add(RebootButtonCheckOn); + RebootButtonCheckOn->SetVisible(true); + + // Add Button to App + if (RebootButtonCheckOff == nullptr) + { + RebootButtonCheckOff = new UIButton(); + } + RebootButtonCheckOff->SetPosition(111, 299); // widget's left position and top position + RebootButtonCheckOff->Resize(100, 100); // widget's width and height + RebootButtonCheckOff->SetViewId(REBOOT_CHECKOFF); // Set style + RebootButtonCheckOff->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + RebootButtonCheckOff->SetImageSrc(PNG_SYSTEM_CHECK_OFF_IMAGE, nullptr); + RebootButtonCheckOff->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED); + RebootButtonCheckOff->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + // Add the CallBack about events + UIView::OnClickListener *RebootButtonCheckOffClick = static_cast(SystemRebootPresenter::GetInstance()); + RebootButtonCheckOff->SetOnClickListener(RebootButtonCheckOffClick); + // Add to rootView + container_->Add(RebootButtonCheckOff); + RebootButtonCheckOff->SetVisible(true); + } + + void SystemRebootView::DeInitView() + { + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + if (RebootImage != nullptr) + { + delete RebootImage; + RebootImage = nullptr; + } + if (RebootButtonCheckOn != nullptr) + { + delete RebootButtonCheckOn; + RebootButtonCheckOn = nullptr; + } + if (RebootButtonCheckOff != nullptr) + { + delete RebootButtonCheckOff; + RebootButtonCheckOff = nullptr; + } + } + + void SystemRebootView::OnStart() + { + View::OnStart(); + InitView(); + RootView::GetInstance()->Add(container_); + } + + void SystemRebootView::OnSetUpView() + { + View::OnSetUpView(); + Draw(); + } + + void SystemRebootView::OnTearDownView() + { + View::OnTearDownView(); + return; + } + + void SystemRebootView::OnStop() + { + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemShoutDownPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemShoutDownPresenter.cpp new file mode 100644 index 000000000..b4f0ec387 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemShoutDownPresenter.cpp @@ -0,0 +1,81 @@ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "graphic_math.h" +#include "string.h" +#include "system/include/SystemShoutDownPresenter.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static SystemShoutDownPresenter *g_pSystemShoutDownPresenter = nullptr; + + SystemShoutDownPresenter::SystemShoutDownPresenter() + { + + g_pSystemShoutDownPresenter = this; + } + + SystemShoutDownPresenter::~SystemShoutDownPresenter() + { + + g_pSystemShoutDownPresenter = nullptr; + } + + SystemShoutDownPresenter *SystemShoutDownPresenter::GetInstance() + { + + return g_pSystemShoutDownPresenter; + } + + void SystemShoutDownPresenter::OnStart() + { + + Presenter::OnStart(); + } + + void SystemShoutDownPresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void SystemShoutDownPresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void SystemShoutDownPresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool SystemShoutDownPresenter::OnDrag(UIView &view, const DragEvent &event) + { + UNUSED(view); + UNUSED(event); + return true; + } + extern "C" { + //关机 + void uapi_sys_shipmode(uint32_t arg); + } + bool SystemShoutDownPresenter::OnClick(UIView &view, const ClickEvent &event) + { + + // 根据控件id查找是哪个控件触发了点击回调 + if (strcmp(view.GetViewId(), SHOUTDOWN_BUTTON_CHECKON) == 0) + { + uapi_sys_shipmode(0); + return true; + } + else if (strcmp(view.GetViewId(), SHOUTDOWN_BUTTON_CHECKOFF) == 0) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemShoutDownView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemShoutDownView.cpp new file mode 100644 index 000000000..033635479 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemShoutDownView.cpp @@ -0,0 +1,138 @@ +#include "system/include/SystemShoutDownView.h" +#include "system/include/SystemShoutDownPresenter.h" + +#include "UiConfig.h" + +namespace OHOS +{ + + static SystemShoutDownView *g_pSystemShoutDownView{nullptr}; + + SystemShoutDownView::SystemShoutDownView() + { + g_pSystemShoutDownView = this; + } + + SystemShoutDownView::~SystemShoutDownView() + { + DeInitView(); + g_pSystemShoutDownView = nullptr; + } + + SystemShoutDownView *SystemShoutDownView::GetInstance() + { + return g_pSystemShoutDownView; + } + + void SystemShoutDownView::InitView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + } + // Add ImageView to App + if (ShoutDownImage == nullptr) + { + ShoutDownImage = new UIImageView(); + } + ShoutDownImage->SetPosition(0, 0); // widget's left position and top position + ShoutDownImage->Resize(466, 466); // widget's width and height + ShoutDownImage->SetViewId("ShoutDownImage"); // Set style + ShoutDownImage->SetStyle(STYLE_BORDER_RADIUS, 300); + ShoutDownImage->SetSrc("/user/res/system/shoutdown.bin"); + // Add to rootView + container_->Add(ShoutDownImage); + ShoutDownImage->SetVisible(true); + + // Add Button to App + if (ShoutDownButtonCheckOn == nullptr) + { + ShoutDownButtonCheckOn = new UIButton(); + } + ShoutDownButtonCheckOn->SetPosition(256, 299); // widget's left position and top position + ShoutDownButtonCheckOn->Resize(100, 100); // widget's width and height + ShoutDownButtonCheckOn->SetViewId(SHOUTDOWN_BUTTON_CHECKON); // Set style + ShoutDownButtonCheckOn->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + ShoutDownButtonCheckOn->SetImageSrc(PNG_SYSTEM_CHECK_ON_IMAGE, nullptr); + ShoutDownButtonCheckOn->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED); + ShoutDownButtonCheckOn->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + // Add the CallBack about events + UIView::OnClickListener *ShoutDownButtonCheckOnClick = static_cast(SystemShoutDownPresenter::GetInstance()); + ShoutDownButtonCheckOn->SetOnClickListener(ShoutDownButtonCheckOnClick); + // Add to rootView + container_->Add(ShoutDownButtonCheckOn); + ShoutDownButtonCheckOn->SetVisible(true); + + // Add Button to App + if (ShoutDownButtonCheckOff == nullptr) + { + ShoutDownButtonCheckOff = new UIButton(); + } + ShoutDownButtonCheckOff->SetPosition(111, 299); // widget's left position and top position + ShoutDownButtonCheckOff->Resize(100, 100); // widget's width and height + ShoutDownButtonCheckOff->SetViewId(SHOUTDOWN_BUTTON_CHECKOFF); // Set style + ShoutDownButtonCheckOff->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + ShoutDownButtonCheckOff->SetImageSrc(PNG_SYSTEM_CHECK_OFF_IMAGE, nullptr); + ShoutDownButtonCheckOff->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED); + ShoutDownButtonCheckOff->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + // Add the CallBack about events + UIView::OnClickListener *ShoutDownButtonCheckOffClick = static_cast(SystemShoutDownPresenter::GetInstance()); + ShoutDownButtonCheckOff->SetOnClickListener(ShoutDownButtonCheckOffClick); + // Add to rootView + container_->Add(ShoutDownButtonCheckOff); + ShoutDownButtonCheckOff->SetVisible(true); + } + + void SystemShoutDownView::DeInitView() + { + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + if (ShoutDownImage != nullptr) + { + delete ShoutDownImage; + ShoutDownImage = nullptr; + } + if (ShoutDownButtonCheckOn != nullptr) + { + delete ShoutDownButtonCheckOn; + ShoutDownButtonCheckOn = nullptr; + } + if (ShoutDownButtonCheckOff != nullptr) + { + delete ShoutDownButtonCheckOff; + ShoutDownButtonCheckOff = nullptr; + } + } + + void SystemShoutDownView::OnStart() + { + View::OnStart(); + InitView(); + RootView::GetInstance()->Add(container_); + } + + void SystemShoutDownView::OnSetUpView() + { + View::OnSetUpView(); + Draw(); + } + + void SystemShoutDownView::OnTearDownView() + { + View::OnTearDownView(); + return; + } + + void SystemShoutDownView::OnStop() + { + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemSupervisePresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemSupervisePresenter.cpp new file mode 100644 index 000000000..54050ed52 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemSupervisePresenter.cpp @@ -0,0 +1,74 @@ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "graphic_math.h" +#include "string.h" +#include "system/include/SystemSupervisePresenter.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static SystemSupervisePresenter *g_pSystemSupervisePresenter = nullptr; + + SystemSupervisePresenter::SystemSupervisePresenter() + { + + g_pSystemSupervisePresenter = this; + } + + SystemSupervisePresenter::~SystemSupervisePresenter() + { + + g_pSystemSupervisePresenter = nullptr; + } + + SystemSupervisePresenter *SystemSupervisePresenter::GetInstance() + { + + return g_pSystemSupervisePresenter; + } + + void SystemSupervisePresenter::OnStart() + { + + Presenter::OnStart(); + } + + void SystemSupervisePresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void SystemSupervisePresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void SystemSupervisePresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool SystemSupervisePresenter::OnDrag(UIView &view, const DragEvent &event) + { + + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && + (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY())))) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_SYSTEM); + return true; + } + return false; + } + + bool SystemSupervisePresenter::OnClick(UIView &view, const ClickEvent &event) + { + + // 根据控件id查找是哪个控件触发了点击回调 + // if (strcmp(view.GetViewId(), 控件ID) == 0) + 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 new file mode 100644 index 000000000..d410eab5d --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemSuperviseView.cpp @@ -0,0 +1,176 @@ +#include "system/include/SystemSuperviseView.h" +#include "system/include/SystemSupervisePresenter.h" + +namespace OHOS +{ + + static SystemSuperviseView *g_pSystemSuperviseView{nullptr}; + + SystemSuperviseView::SystemSuperviseView() + { + + g_pSystemSuperviseView = this; + } + + SystemSuperviseView::~SystemSuperviseView() + { + DeInitView(); + g_pSystemSuperviseView = nullptr; + } + + SystemSuperviseView *SystemSuperviseView::GetInstance() + { + + return g_pSystemSuperviseView; + } + 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(); + label->SetPosition(left, top); // 位置 + label->Resize(width, height); // 大小 + label->SetViewId(viewId); // id + label->SetStyle(STYLE_TEXT_FONT, fontSize); // 字体大小 + label->SetStyle(STYLE_LINE_HEIGHT, fontlineHeigh); // 字体行高 + label->SetText(text); // 内容 + label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label->SetRollSpeed(speed); + label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, fontSize); + + return label; + } + + void SystemSuperviseView::InitView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + UIView::OnDragListener *draglistener = static_cast(SystemSupervisePresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + container_->SetTouchable(true); + container_->SetDraggable(true); + } + if (scrollView1_ == nullptr) + { + scrollView1_ = new UIScrollView(); + } + scrollView1_->SetPosition(0, 0); // widget's left position and top position + scrollView1_->Resize(466, 466); // widget's width and height + scrollView1_->SetViewId("scrollView"); // Set style + scrollView1_->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + scrollView1_->SetStyle(STYLE_BORDER_RADIUS, 1294); + + container_->Add(scrollView1_); + scrollView1_->SetVisible(true); + /***********************************************************************************************************/ + if (label1_ == nullptr) + { + label1_ = InitLabel(203, 52, 60, 35, "监管", "label1", 30, 35, 6); + } + scrollView1_->Add(label1_); + label1_->SetVisible(true); + /***********************************************************************************************************/ + if (label2_ == nullptr) + { + label2_ = InitLabel(203, 164, 60, 35, "型号", "label2", 30, 35, 6); + } + scrollView1_->Add(label2_); + label2_->SetVisible(true); + /***********************************************************************************************************/ + if (label3_ == nullptr) + { + label3_ = InitLabel(102, 221, 263, 30, "周冰鸿的 Smart Watch", "label3", 26, 30, 6); + } + label3_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); + scrollView1_->Add(label3_); + label3_->SetVisible(true); + /***********************************************************************************************************/ + if (label4_ == nullptr) + { + label4_ = InitLabel(198, 310, 71, 35, "CMIT", "label4", 30, 35, 6); + } + scrollView1_->Add(label4_); + label4_->SetVisible(true); + /***********************************************************************************************************/ + if (label5_ == nullptr) + { + label5_ = InitLabel(175, 367, 119, 30, "V02.03.01", "label5", 26, 30, 6); + } + label5_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); + scrollView1_->Add(label5_); + label5_->SetVisible(true); + } + + void SystemSuperviseView::DeInitView() + { + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + if (scrollView1_ != nullptr) + { + delete scrollView1_; + scrollView1_ = nullptr; + } + if (label1_ != nullptr) + { + delete label1_; + label1_ = nullptr; + } + if (label2_ != nullptr) + { + delete label2_; + label2_ = nullptr; + } + if (label3_ != nullptr) + { + delete label3_; + label3_ = nullptr; + } + if (label4_ != nullptr) + { + delete label4_; + label4_ = nullptr; + } + if (label5_ != nullptr) + { + delete label5_; + label5_ = nullptr; + } + } + + void SystemSuperviseView::OnStart() + { + InitView(); + RootView::GetInstance()->Add(container_); + } + + void SystemSuperviseView::OnSetUpView() + { + View::OnSetUpView(); + Draw(); + } + + void SystemSuperviseView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void SystemSuperviseView::OnStop() + { + + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} \ 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 new file mode 100644 index 000000000..029272039 --- /dev/null +++ b/code/sdk/application/wearable/nativeapp/nativeui/system/src/SystemView.cpp @@ -0,0 +1,319 @@ +#include "system/include/SystemView.h" +#include "system/include/SystemPresenter.h" + +#include "UiConfig.h" + +namespace OHOS +{ + + static SystemView *g_pSystemView{nullptr}; + + SystemView::SystemView() + { + g_pSystemView = this; + } + + SystemView::~SystemView() + { + DeInitView(); + g_pSystemView = nullptr; + } + + SystemView *SystemView::GetInstance() + { + + return g_pSystemView; + } + + void SystemView::InitIView() + { + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + UIView::OnDragListener *draglistener = static_cast(SystemPresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + container_->SetTouchable(true); + container_->SetDraggable(true); + } + /***********************************************************************************************************/ + // Add ScrollView to App + if (SystemScrollView == nullptr) + { + SystemScrollView = new UIScrollView(); + } + SystemScrollView->SetPosition(0, 0); // widget's left position and top position + SystemScrollView->Resize(466, 466); // widget's width and height + SystemScrollView->SetViewId("SystemScrollView"); // Set style + SystemScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + container_->Add(SystemScrollView); + SystemScrollView->SetVisible(true); + /***********************************************************************************************************/ + // Add Label to App + if (SystemLabel == nullptr) + { + SystemLabel = new UILabel(); + } + SystemLabel->SetPosition(203, 52); // widget's left position and top position + SystemLabel->Resize(200, 60); // widget's width and height + SystemLabel->SetViewId("SystemLabel"); // Set style + SystemLabel->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + SystemLabel->SetStyle(STYLE_TEXT_FONT, 30); + SystemLabel->SetStyle(STYLE_LINE_HEIGHT, 35); + // Set additional property + SystemLabel->SetText("系统"); + SystemLabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + SystemLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + SystemLabel->SetRollSpeed(6); + SystemLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + // Add to scrollView3 + SystemScrollView->Add(SystemLabel); + SystemLabel->SetVisible(true); + /***********************************************************************************************************/ + // Add Button to App + if (AboutTheWatchButton == nullptr) + { + AboutTheWatchButton = new UIButton(); + } + AboutTheWatchButton->SetPosition(43, 120); // widget's left position and top position + AboutTheWatchButton->Resize(380, 100); // widget's width and height + AboutTheWatchButton->SetViewId(ABOUT_THE_WATCH); // Set style //关于手表 + AboutTheWatchButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + AboutTheWatchButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + AboutTheWatchButton->SetImageSrc("/user/res/system/SYSTEM_ABOUT_THE_WATCH.bin", nullptr); + AboutTheWatchButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + // Add the CallBack about events + UIView::OnClickListener *AboutTheWatchButtonClick = static_cast(SystemPresenter::GetInstance()); + AboutTheWatchButton->SetOnClickListener(AboutTheWatchButtonClick); + // Add to scrollView3 + SystemScrollView->Add(AboutTheWatchButton); + AboutTheWatchButton->SetVisible(true); + /***********************************************************************************************************/ + // Add Button to App + if (SuperviseButton == nullptr) + { + SuperviseButton = new UIButton(); + } + SuperviseButton->SetPosition(43, 240); // widget's left position and top position + SuperviseButton->Resize(380, 100); // widget's width and height + SuperviseButton->SetViewId(SUPERVISE); // Set style //监管 + SuperviseButton->SetStyle(STYLE_BORDER_RADIUS, 50); + SuperviseButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + SuperviseButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + SuperviseButton->SetImageSrc("/user/res/system/SYSTEM_SUPERVISE.bin", nullptr); + SuperviseButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + SuperviseButton->SetStyleForState(STYLE_BORDER_RADIUS, 50, UIButton::PRESSED); + + // Add the CallBack about events + UIView::OnClickListener *SuperviseButtonClick = static_cast(SystemPresenter::GetInstance()); + SuperviseButton->SetOnClickListener(SuperviseButtonClick); + // Add to scrollView3 + SystemScrollView->Add(SuperviseButton); + SuperviseButton->SetVisible(true); + /***********************************************************************************************************/ + // Add Button to App + if (SystemLanguageButton == nullptr) + { + SystemLanguageButton = new UIButton(); + } + SystemLanguageButton->SetPosition(43, 360); // widget's left position and top position + SystemLanguageButton->Resize(380, 100); // widget's width and height + SystemLanguageButton->SetViewId(SYSTEM_LANGUAGE); // Set style //系统语言 + SystemLanguageButton->SetStyle(STYLE_BORDER_RADIUS, 50); + SystemLanguageButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + SystemLanguageButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + + SystemLanguageButton->SetImageSrc("/user/res/system/SYSTEM_SYSTEM_LANGUAGE.bin", nullptr); + SystemLanguageButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + SystemLanguageButton->SetStyleForState(STYLE_BORDER_RADIUS, 50, UIButton::PRESSED); + + // Add the CallBack about events + UIView::OnClickListener *SystemLanguageButtonClick = static_cast(SystemPresenter::GetInstance()); + SystemLanguageButton->SetOnClickListener(SystemLanguageButtonClick); + // Add to scrollView3 + SystemScrollView->Add(SystemLanguageButton); + SystemLanguageButton->SetVisible(true); + /***********************************************************************************************************/ + // Add Button to App + if (RebootButton == nullptr) + { + RebootButton = new UIButton(); + } + RebootButton->SetPosition(43, 480); // widget's left position and top position + RebootButton->Resize(380, 100); // widget's width and height + RebootButton->SetViewId(REBOOT); // Set style //重启 + RebootButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + RebootButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + RebootButton->SetImageSrc("/user/res/system/SYSTEM_REBOOT.bin", nullptr); + RebootButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + // Add the CallBack about events + UIView::OnClickListener *RebootButtonClick = static_cast(SystemPresenter::GetInstance()); + RebootButton->SetOnClickListener(RebootButtonClick); + // Add to scrollView3 + SystemScrollView->Add(RebootButton); + RebootButton->SetVisible(true); + /***********************************************************************************************************/ + // Add Button to App + if (ShoutdownButton == nullptr) + { + ShoutdownButton = new UIButton(); + } + ShoutdownButton->SetPosition(43, 600); // widget's left position and top position + ShoutdownButton->Resize(380, 100); // widget's width and height + ShoutdownButton->SetViewId(SHOUTDOWM); // Set style //关机 + ShoutdownButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + ShoutdownButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + // Set additional property + char *button5triggeredImgSrc = nullptr; + ShoutdownButton->SetImageSrc("/user/res/system/SYSTEM_SHOUTDOWM.bin", nullptr); + ShoutdownButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + + // Add the CallBack about events + UIView::OnClickListener *ShoutdownButtonClick = static_cast(SystemPresenter::GetInstance()); + ShoutdownButton->SetOnClickListener(ShoutdownButtonClick); + // Add to scrollView3 + SystemScrollView->Add(ShoutdownButton); + ShoutdownButton->SetVisible(true); + + /***********************************************************************************************************/ + // Add Button to App + if (FactoryResetButton == nullptr) + { + FactoryResetButton = new UIButton(); + } + FactoryResetButton->SetPosition(43, 720); // widget's left position and top position + FactoryResetButton->Resize(380, 100); // widget's width and height + FactoryResetButton->SetViewId(FACTORY_RESET); // Set style //恢复出厂设置 + FactoryResetButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + FactoryResetButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + FactoryResetButton->SetImageSrc("/user/res/system/SYSTEM_FACTORY_RESET.bin", nullptr); + FactoryResetButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + + // Add the CallBack about events + UIView::OnClickListener *FactoryResetButtonClick = static_cast(SystemPresenter::GetInstance()); + FactoryResetButton->SetOnClickListener(FactoryResetButtonClick); + // Add to scrollView3 + SystemScrollView->Add(FactoryResetButton); + FactoryResetButton->SetVisible(true); + /***********************************************************************************************************/ + // Add ImageView to App + if (image1_ == nullptr) + { + image1_ = new UIImageView(); + } + image1_->SetPosition(171, 801); // widget's left position and top position + image1_->Resize(100, 100); // widget's width and height + image1_->SetViewId("image1"); // Set style + + // Add to scrollView3 + SystemScrollView->Add(image1_); + image1_->SetVisible(true); + /***********************************************************************************************************/ + // Add ImageView to App + if (image2_ == nullptr) + { + image2_ = new UIImageView(); + } + image2_->SetPosition(183, 21); // widget's left position and top position + image2_->Resize(100, 100); // widget's width and height + image2_->SetViewId("image2"); // Set style + // Add to scrollView3 + SystemScrollView->Add(image2_); + image2_->SetVisible(true); + } + + void SystemView::DeInitView() + { + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + if (SystemScrollView != nullptr) + { + delete SystemScrollView; + SystemScrollView = nullptr; + } + if (SystemLabel != nullptr) + { + delete SystemLabel; + SystemLabel = nullptr; + } + if (image2_ != nullptr) + { + delete image2_; + image2_ = nullptr; + } + if (image1_ != nullptr) + { + delete image1_; + image1_ = nullptr; + } + if (FactoryResetButton != nullptr) + { + delete FactoryResetButton; + FactoryResetButton = nullptr; + } + if (ShoutdownButton != nullptr) + { + delete ShoutdownButton; + ShoutdownButton = nullptr; + } + if (RebootButton != nullptr) + { + delete RebootButton; + RebootButton = nullptr; + } + if (AboutTheWatchButton != nullptr) + { + delete AboutTheWatchButton; + AboutTheWatchButton = nullptr; + } + if (SuperviseButton != nullptr) + { + delete SuperviseButton; + SuperviseButton = nullptr; + } + if (SystemLanguageButton != nullptr) + { + delete SystemLanguageButton; + SystemLanguageButton = nullptr; + } + } + + void SystemView::OnStart() + { + View::OnStart(); + InitIView(); + RootView::GetInstance()->Add(container_); + } + + void SystemView::OnSetUpView() + { + View::OnSetUpView(); + Draw(); + } + + void SystemView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void SystemView::OnStop() + { + + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp index 0db223d38..7a8bce270 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/traing/src/TraingView.cpp @@ -14,13 +14,14 @@ namespace OHOS TraingView::TraingView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TraingView::TraingView"); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); g_pTraingView = this; } TraingView::~TraingView() { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TraingView::~TraingView()"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TraingView::~TraingView"); RemoveAll(); DeInit(); g_pTraingView = nullptr; @@ -273,7 +274,6 @@ namespace OHOS } void TraingView::PreLoad(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TraingView::PreLoad(void)"); if (!viewiInitStatus) { InitView(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/weather/src/WeatherControlView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/weather/src/WeatherControlView.cpp index 43affebe3..280d9da57 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/weather/src/WeatherControlView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/weather/src/WeatherControlView.cpp @@ -4,13 +4,13 @@ namespace OHOS { WeatherControlView::WeatherControlView() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherControlView::WeatherControlView()"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherControlView::WeatherControlView"); SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); } WeatherControlView::~WeatherControlView() { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherControlView::~WeatherControlView()"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WeatherControlView::~WeatherControlView"); ClearAll(); } diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_ABOUT_THE_WATCH.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_ABOUT_THE_WATCH.bin new file mode 100644 index 000000000..80d4c93fa Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_ABOUT_THE_WATCH.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_FACTORY_RESET.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_FACTORY_RESET.bin new file mode 100644 index 000000000..8f865576d Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_FACTORY_RESET.bin differ 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 new file mode 100644 index 000000000..ac88ca2bb Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_REBOOT.bin 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 new file mode 100644 index 000000000..5fb1c58ef Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_SHOUTDOWM.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_SUPERVISE.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_SUPERVISE.bin new file mode 100644 index 000000000..af74f08aa Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_SUPERVISE.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_SYSTEM_LANGUAGE.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_SYSTEM_LANGUAGE.bin new file mode 100644 index 000000000..1ebc74b5c Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/SYSTEM_SYSTEM_LANGUAGE.bin differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/factoryreset.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/factoryreset.bin new file mode 100644 index 000000000..803e4346b Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/factoryreset.bin 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 new file mode 100644 index 000000000..fb50225d1 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/reboot.bin 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 new file mode 100644 index 000000000..8ee51a27d Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fs/user/res/system/shoutdown.bin differ