From 4cdb6c34c1af609e38210d537231c401dbfb26c4 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 23 Apr 2024 19:19:01 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E8=BF=90=E5=8A=A8=E8=AF=86?= =?utf8?q?=E5=88=ABSlice?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wearable/fd230app/CMakeLists.txt | 4 + .../nativelauncher/include/AppViewIDs.h | 1 + .../nativelauncher/include/NativeLauncher.h | 1 + .../nativelauncher/src/NativeLauncher.cpp | 17 +- .../include/MotionRecognitionPresenter.h | 41 +++++ .../include/MotionRecognitionView.h | 44 +++++ .../src/MotionRecognitionPresenter.cpp | 115 ++++++++++++ .../src/MotionRecognitionView.cpp | 171 ++++++++++++++++++ .../nativeui/settings/include/SettingItem.h | 3 +- .../nativeui/settings/src/SettingModel.cpp | 13 +- 10 files changed, 402 insertions(+), 8 deletions(-) create mode 100644 code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionPresenter.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionPresenter.cpp create mode 100644 code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index 2daf9023e..362be0696 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -322,6 +322,10 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/networkandcall/src/NetworkAndCallView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/networkandcall/src/MobileDataOptionsView.cpp + #运动识别 + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/motionrecognition/src/MotionRecognitionPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/motionrecognition/src/MotionRecognitionView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/language/LanguageInit.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/config/src/ConfigModel.cpp diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h index c0dd7bf6e..4aae8b9e8 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h @@ -59,6 +59,7 @@ typedef enum : uint16_t VIEW_FLASHLIGHT, // 手电筒 VIEW_BRIGHTNESSLEVEL, // 亮度调节 VIEW_NETWORKANDCALL, // 网络与通话 + VIEW_MOTION_RECOGNITION, // 运动识别 /* ----------------------------------- 录音 ----------------------------------- */ VIEW_RECORD, /* ---------------------------------- 界面 ---------------------------------- */ diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h index 3e4986fd3..8af622f47 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h @@ -55,6 +55,7 @@ namespace OHOS void InitFlashlightSlice(void); void InitBrightnessLevelSlice(void); void InitNetworkAndCallSlice(void); + void InitMotionRecognitionSlice(void); /* --------------------------------界面------------------------------------ */ void InitRotateSlice(void); void InitBloodSlice(void); diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index ca62c880e..38660a6ce 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -161,6 +161,9 @@ #include "networkandcall/include/NetworkAndCallPresenter.h" #include "networkandcall/include/NetworkAndCallView.h" + +#include "motionrecognition/include/MotionRecognitionPresenter.h" +#include "motionrecognition/include/MotionRecognitionView.h" /* -------------------------------------------------------------------------- */ #include "traing/include/TraingView.h" #include "traing/include/TraingPresenter.h" @@ -246,7 +249,8 @@ namespace OHOS {VIEW_CALL_VOLUME, &NativeLauncher::InitCallVolumeSlice}, // 系统音量 {VIEW_CLASSIC_BLUETOOTH, &NativeLauncher::InitClassicBluetoothSlice}, // 经典蓝牙slice {VIEW_DISPLAY_BRIGHTNESS, &NativeLauncher::InitDisplayBrightnessSlice}, // 显示与亮度的实例化地址 - {VIEW_NETWORKANDCALL, &NativeLauncher::InitNetworkAndCallSlice}, // 网络与通话 + {VIEW_NETWORKANDCALL, &NativeLauncher::InitNetworkAndCallSlice}, // 网络与通话 + {VIEW_MOTION_RECOGNITION, &NativeLauncher::InitMotionRecognitionSlice}, // 网络与通话 // {VIEW_SECONDARY_FUNCTION, &NativeLauncher::InitSecondaryFunction}, // {VIEW_FAST_TRAINING, &NativeLauncher::InitFastTrainingSlice}, @@ -1061,6 +1065,17 @@ namespace OHOS NativeAbility::GetInstance().AddSliceProxy(VIEW_NETWORKANDCALL, networkandcall); } + /*网络与通话*/ + void NativeLauncher::InitMotionRecognitionSlice(void) + { + SliceProxy *motionrecognition = new AbilitySliceProxy; + if (motionrecognition == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "motionrecognition"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_MOTION_RECOGNITION, motionrecognition); + } /* -------------------------------------------------------------------------- */ void NativeLauncher::InitSetDesktopSlice(void) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionPresenter.h new file mode 100644 index 000000000..c97609888 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionPresenter.h @@ -0,0 +1,41 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-23 17:32:20 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 17:42:37 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionPresenter.h + */ +#ifndef MOTION_RECOGNITION_PRESENTER_H +#define MOTION_RECOGNITION_PRESENTER_H + +#include "Presenter.h" +#include "View.h" + +namespace OHOS +{ + class MotionRecognitionView; + class MotionRecognitionPresenter : public Presenter, + public UIView::OnClickListener, + public RootView::OnKeyActListener, + public UIView::OnDragListener + { + public: + MotionRecognitionPresenter(); + virtual ~MotionRecognitionPresenter(); + + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + + static MotionRecognitionPresenter *GetInstance(); + + private: + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + bool OnDragEnd(UIView &view, const DragEvent &event) override; + bool OnKeyAct(UIView &view, const KeyEvent &event) override; // 增加按键事件 + }; +} + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h new file mode 100644 index 000000000..28e9bf1ad --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h @@ -0,0 +1,44 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-23 17:29:18 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 18:03:26 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h + */ +#ifndef MOTION_RECOGNITION_VIEW_H +#define MOTION_RECOGNITION_VIEW_H + +#include "BaseView.h" +#include "View.h" + +#include "components/ui_scroll_view.h" +#include "components/ui_label_ext.h" +#include "components/ui_image_view.h" +#include "components/ui_toggle_button.h" +namespace OHOS +{ + class MotionRecognitionPresenter; + class MotionRecognitionView : public View + { + + public: + MotionRecognitionView(); + virtual ~MotionRecognitionView(); + static MotionRecognitionView *GetInstance(void); + UIToggleButton *GetMotionRecognitionToggleButton(void); + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + void MotionRecognitionViewInit(void); + void ClearAll(void); + UIScrollView *scrollView = nullptr; + UILabel *Title = nullptr; + UIImageView *MotionRecognitionImage = nullptr; + UILabel *MotionRecognitionLabel = nullptr; + UIToggleButton *MotionRecognitionToggleButton = nullptr; + }; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionPresenter.cpp new file mode 100644 index 000000000..a322c4a45 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionPresenter.cpp @@ -0,0 +1,115 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-03-28 14:17:43 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 18:12:26 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/language/src/MotionRecognitionPresenter.cpp + */ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "motionrecognition/include/MotionRecognitionPresenter.h" +#include "motionrecognition/include/MotionRecognitionView.h" +#include "common/key_code.h" +#include + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static MotionRecognitionPresenter *g_pMotionRecognitionPresenter = nullptr; + + MotionRecognitionPresenter::MotionRecognitionPresenter() + { + g_pMotionRecognitionPresenter = this; + } + + MotionRecognitionPresenter::~MotionRecognitionPresenter() + { + g_pMotionRecognitionPresenter = nullptr; + } + + MotionRecognitionPresenter *MotionRecognitionPresenter::GetInstance() + { + return g_pMotionRecognitionPresenter; + } + + void MotionRecognitionPresenter::OnStart() + { + Presenter::OnStart(); + } + + void MotionRecognitionPresenter::OnPause(void) + { + Presenter::OnPause(); + } + + void MotionRecognitionPresenter::OnResume(void) + { + Presenter::OnResume(); + } + + void MotionRecognitionPresenter::OnStop(void) + { + Presenter::OnStop(); + } + + bool MotionRecognitionPresenter::OnClick(UIView &view, const ClickEvent &event) + { + UNUSED(event); + MotionRecognitionView *p_MotionRecognitionView = MotionRecognitionView::GetInstance(); + if (p_MotionRecognitionView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " MotionRecognitionView::GetInstance() fail!"); + return false; + } + + UIToggleButton *toggleButton = dynamic_cast(&view); + if (p_MotionRecognitionView->GetMotionRecognitionToggleButton() == toggleButton) + { + if (toggleButton != nullptr) + { + if (toggleButton->GetState() == true) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognition is enable!"); + } + else + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognition is disable!"); + } + } + } + + return true; + } + + bool MotionRecognitionPresenter::OnDrag(UIView &view, const DragEvent &event) + { + UNUSED(view); + UNUSED(event); + return true; + } + + bool MotionRecognitionPresenter::OnDragEnd(UIView &view, const DragEvent &event) + { + UNUSED(view); + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) + { + NativeAbility::GetInstance().Back(); + } + return true; + } + + bool MotionRecognitionPresenter::OnKeyAct(UIView &view, const KeyEvent &event) // 增加按键事件 + { + UNUSED(view); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MotionRecognitionPresenter::OnKeyAct"); + unsigned short keyID = event.GetKeyId(); + unsigned short keyState = event.GetState(); + // 如果是power键,且是亮屏状态,按键释放就返回上一级 + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0) + { + NativeAbility::GetInstance().Back(); + } + return true; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp new file mode 100644 index 000000000..3547c014b --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp @@ -0,0 +1,171 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-23 17:28:52 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 19:09:24 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp + */ +#include "motionrecognition/include/MotionRecognitionPresenter.h" +#include "motionrecognition/include/MotionRecognitionView.h" +#include "wearable_log.h" +namespace OHOS +{ + + static MotionRecognitionView *g_pMotionRecognitionView{nullptr}; + + MotionRecognitionView::MotionRecognitionView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognitionView::MotionRecognitionView"); + g_pMotionRecognitionView = this; + } + + MotionRecognitionView::~MotionRecognitionView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognitionView::~MotionRecognitionView"); + ClearAll(); + g_pMotionRecognitionView = nullptr; + } + + MotionRecognitionView *MotionRecognitionView::GetInstance() + { + return g_pMotionRecognitionView; + } + + void MotionRecognitionView::ClearAll(void) + { + if (scrollView != nullptr) + { + scrollView->RemoveAll(); + + if (Title != nullptr) + { + delete Title; + Title = nullptr; + } + + if (MotionRecognitionImage != nullptr) + { + delete MotionRecognitionImage; + MotionRecognitionImage = nullptr; + } + if (MotionRecognitionLabel != nullptr) + { + delete MotionRecognitionLabel; + MotionRecognitionLabel = nullptr; + } + + if (MotionRecognitionToggleButton != nullptr) + { + delete MotionRecognitionToggleButton; + MotionRecognitionToggleButton = nullptr; + } + + delete scrollView; + scrollView = nullptr; + } + } + + void MotionRecognitionView::MotionRecognitionViewInit(void) + { + + if (scrollView == nullptr) + { + scrollView = new UIScrollView(); + scrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + scrollView->SetScrollBlankSize(50); + scrollView->SetReboundSize(35); + /* -------------------------------------------------------------------------- */ + if (Title == nullptr) + { + Title = new UILabel(); + } + Title->SetPosition(83, 50, 300, 40); + Title->SetStyle(STYLE_TEXT_FONT, 30); + Title->SetStyle(STYLE_LINE_HEIGHT, 35); + Title->SetText("运动识别"); + Title->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + Title->SetRollSpeed(40); + Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + Title->SetVisible(true); + /* -------------------------------------------------------------------------- */ + if (MotionRecognitionImage == nullptr) + { + MotionRecognitionImage = new UIImageView(); + } + MotionRecognitionImage->SetPosition(43, 120, 380, 100); + MotionRecognitionImage->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + MotionRecognitionImage->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + MotionRecognitionImage->SetStyle(STYLE_BORDER_RADIUS, 100); + /* -------------------------------------------------------------------------- */ + if (MotionRecognitionLabel == nullptr) + { + MotionRecognitionLabel = new UILabel(); + } + MotionRecognitionLabel->SetPosition(90, 153, 180, 40); + MotionRecognitionLabel->SetStyle(STYLE_TEXT_FONT, 30); + MotionRecognitionLabel->SetStyle(STYLE_LINE_HEIGHT, 35); + MotionRecognitionLabel->SetText("自动识别"); + MotionRecognitionLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + MotionRecognitionLabel->SetRollSpeed(40); + MotionRecognitionLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + /* -------------------------------------------------------------------------- */ + MotionRecognitionToggleButton = new UIToggleButton(); + if (MotionRecognitionToggleButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::MotionRecognitionToggleButton is nullptr!"); + return; + } + MotionRecognitionToggleButton->SetPosition(298, 145, 100, 50); + MotionRecognitionToggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + const char *selectedImg = "/user/res/TOGGLEBUTTON_ON.bin"; + const char *unSelectedImg = "/user/res/TOGGLEBUTTON_OFF.bin"; + MotionRecognitionToggleButton->SetImages(selectedImg, unSelectedImg); + /* ----------------------------- onclickListener ---------------------------- */ + UIView::OnClickListener *toggleButtonClick = static_cast(MotionRecognitionPresenter::GetInstance()); + MotionRecognitionToggleButton->SetOnClickListener(toggleButtonClick); + } + } + + void MotionRecognitionView::OnStart() + { + View::OnStart(); + MotionRecognitionViewInit(); + // 增加按键监听 + RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::MotionRecognitionPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); + } + + void MotionRecognitionView::OnSetUpView() + { + View::OnSetUpView(); + scrollView->Add(Title); + scrollView->Add(MotionRecognitionImage); + scrollView->Add(MotionRecognitionLabel); + scrollView->Add(MotionRecognitionToggleButton); + RootView::GetInstance()->Add(scrollView); + Draw(); + } + + void MotionRecognitionView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void MotionRecognitionView::OnStop() + { + + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + RootView::GetInstance()->ClearOnKeyActListener(); + return; + } + + UIToggleButton *MotionRecognitionView::GetMotionRecognitionToggleButton(void) + { + return MotionRecognitionToggleButton; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItem.h b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItem.h index e4de67b4b..8c17b999c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItem.h +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItem.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-23 10:48:57 + * @LastEditTime: 2024-04-23 18:09:12 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItem.h */ #ifndef SETTING_ITEM_H @@ -25,6 +25,7 @@ namespace OHOS SETTING_ITEM_FOUR, SETTING_ITEM_FIVE, SETTING_ITEM_SIX, + SETTING_ITEM_SEVEN, SETTING_ITEM_MAX, } SettingIndex; diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp index eb3b7a8f7..79c3862c6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-02-18 09:09:13 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-23 14:23:59 + * @LastEditTime: 2024-04-23 18:09:47 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp */ #include "SettingModel.h" @@ -27,16 +27,17 @@ namespace OHOS settings[2] = {SETTING_ITEM_TWO, PNG_SETTINGS_BLUETOOTH, STR_BLUETOOTH, true}; settings[3] = {SETTING_ITEM_THREE, PNG_SETTINGS_SOUND_VIBRATION, STR_SOUND_AND_VIBRATION, true}; settings[4] = {SETTING_ITEM_FOUR, PNG_SETTINGS_DISPLAY_MODE, STR_DISPLAY_MODE, true}; - //settings[5] = {SETTING_ITEM_FIVE, PNG_SETTINGS_MOTION_RECOGNITION, STR_MOTION_RECOGNITION, true}; - settings[5] = {SETTING_ITEM_FIVE, PNG_SETTINGS_SYSTEM, STR_SYSTEM, true}; - settings[6] = {SETTING_ITEM_SIX, PNG_SETTINGS_SETTINGS_POWER_CONTROL, STR_SHUTDOWN_AND_RESTART, true}; + settings[5] = {SETTING_ITEM_FIVE, PNG_SETTINGS_MOTION_RECOGNITION, STR_MOTION_RECOGNITION, true}; + settings[6] = {SETTING_ITEM_SIX, PNG_SETTINGS_SYSTEM, STR_SYSTEM, true}; + settings[7] = {SETTING_ITEM_SEVEN, PNG_SETTINGS_SETTINGS_POWER_CONTROL, STR_SHUTDOWN_AND_RESTART, true}; settingIdToViewId.insert(std::pair(SETTING_ITEM_ZERO, VIEW_DISPLAY_BRIGHTNESS)); settingIdToViewId.insert(std::pair(SETTING_ITEM_ONE, VIEW_NETWORKANDCALL)); settingIdToViewId.insert(std::pair(SETTING_ITEM_TWO, VIEW_CLASSIC_BLUETOOTH)); settingIdToViewId.insert(std::pair(SETTING_ITEM_THREE, VIEW_SOUND_VIBRATION)); settingIdToViewId.insert(std::pair(SETTING_ITEM_FOUR, VIEW_SET_DESKTOP)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_FIVE, VIEW_SYSTEM)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_SIX, VIEW_SHUTDOWN_OR_REBOOT)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_FIVE, VIEW_MOTION_RECOGNITION)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_SIX, VIEW_SYSTEM)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_SEVEN, VIEW_SHUTDOWN_OR_REBOOT)); } const SettingItem *SettingModel::GetSettinglistItems() const -- 2.17.1