From 8e3a145441b515782afbb220b51a2fdbc4f945fd Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Thu, 25 Apr 2024 09:31:02 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE=E8=A7=86?= =?utf8?q?=E5=9B=BE=E4=B8=AD=E5=BC=80=E5=85=B3=E6=9C=BAicon=EF=BC=8C?= =?utf8?q?=E4=BC=98=E5=8C=96=E6=98=BE=E7=A4=BA=E6=96=B9=E5=BC=8F=E8=A7=86?= =?utf8?q?=E5=9B=BE=E7=9A=84=E9=80=80=E5=87=BA=E6=96=B9=E5=BC=8F=EF=BC=8C?= =?utf8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=85=B3=E6=9C=BA=E8=A7=86=E5=9B=BE?= =?utf8?q?=E7=9A=84incon=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativelauncher/include/UiConfig.h | 4 +- .../rebootdevice/src/RebootDeviceView.cpp | 4 +- .../rebootdevice/src/RebootPresenter.cpp | 14 ++--- .../nativeui/rebootdevice/src/RebootView.cpp | 8 ++- .../rebootdevice/src/ShutdownDeviceView.cpp | 4 +- .../set_desktop/include/SetDesktopPresenter.h | 14 ++++- .../set_desktop/src/SetDesktopPresenter.cpp | 44 +++++++++++++-- .../set_desktop/src/SetDesktopView.cpp | 4 ++ .../nativeui/settings/src/SettingItemView.cpp | 51 +++++++++++------- .../nativeui/settings/src/SettingModel.cpp | 19 +++---- .../res/settings/SETTINGS_POWER_CONTROL.bin | Bin 2840 -> 0 bytes .../SETTINGS_SHUTDOWN_AND_RESTART.bin | Bin 0 -> 3976 bytes .../fs/user/res/settings/SETTTING_REBOOT.bin | Bin 0 -> 1144 bytes .../user/res/settings/SETTTING_SHUTDOWN.bin | Bin 0 -> 1144 bytes 14 files changed, 120 insertions(+), 46 deletions(-) delete mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_POWER_CONTROL.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_SHUTDOWN_AND_RESTART.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTTING_REBOOT.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTTING_SHUTDOWN.bin diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h index 9f88639e0..f2bf91cc1 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h @@ -294,7 +294,9 @@ namespace OHOS static constexpr const char *PNG_SETTINGS_DISPLAY_MODE = APP_RES_PATH "/settings/SETTINGS_DISPLAY_MODE.bin"; // 显示方式 static constexpr const char *PNG_SETTINGS_MOTION_RECOGNITION = APP_RES_PATH "/settings/SETTINGS_MOTION_RECOGNITION.bin"; // 运动识别 static constexpr const char *PNG_SETTINGS_SYSTEM = APP_RES_PATH "/settings/SETTINGS_SYSTEM.bin"; // 系统 - static constexpr const char *PNG_SETTINGS_SETTINGS_POWER_CONTROL = APP_RES_PATH "/settings/SETTINGS_POWER_CONTROL.bin"; // 关机和重启 + static constexpr const char *PNG_SETTINGS_SHUTDOWN_AND_RESTART = APP_RES_PATH "/settings/SETTINGS_SHUTDOWN_AND_RESTART.bin"; // 关机和重启 + static constexpr const char *PNG_SETTINGS_SETTTING_SHUTDOWN = APP_RES_PATH "/settings/SETTTING_SHUTDOWN.bin"; // 关机 + static constexpr const char *PNG_SETTINGS_SETTTING_REBOOT = APP_RES_PATH "/settings/SETTTING_REBOOT.bin"; // 重启 /* ---------------------------------- 消息中心 ---------------------------------- */ static constexpr const char *PNG_Message_System = APP_RES_PATH "/message/system-icon.bin"; // 系统消息 static constexpr const char *PNG_Message_Note = APP_RES_PATH "/message/message-icon.bin"; // 短信 diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootDeviceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootDeviceView.cpp index bd714058c..cad3c66a5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootDeviceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootDeviceView.cpp @@ -64,7 +64,9 @@ bool RebootDeviceView::ShowUpRebootDeviceView() } } rebootDeviceButton->SetPosition(172, 147, 110, 110); // 172:x 147:y 110:width 110:height - rebootDeviceButton->SetImageSrc(PNG_REBOOT_BUTTON_IMAGE, PNG_REBOOT_BUTTON_IMAGE); + rebootDeviceButton->SetImageSrc(PNG_SETTINGS_SETTTING_REBOOT, PNG_SETTINGS_SETTTING_REBOOT); + rebootDeviceButton->SetImagePosition(36, 36); + rebootDeviceButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c); rebootDeviceButton->SetViewId(REBOOTDEVICE_BUTTON); UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance(); if (clickListener == nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootPresenter.cpp index 4448b5848..b2f20fec8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootPresenter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-02-21 19:06:02 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-03-21 14:23:19 + * @LastEditTime: 2024-04-25 09:21:08 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootPresenter.cpp */ #include "rebootdevice/include/RebootPresenter.h" @@ -79,7 +79,7 @@ namespace OHOS RebootView::GetInstance()->ChangeView(SHUTDOWNDEVICEVIEW, SHUTDOWNANIMATORVIEW); start_shutdown_or_reboot(); shutdown_reboot_prejobs(); - + ShutDownAnimatorView::GetInstance()->GeShutDownImageAnimatorView()->Start(); isShutDownOperation = true; } @@ -93,8 +93,9 @@ namespace OHOS { if (strcmp(view.GetViewId(), REBOOT_VIEW) == 0) { - uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); - NativeAbility::GetInstance().ChangeSlice(preSlice); + // uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + // NativeAbility::GetInstance().ChangeSlice(preSlice); + NativeAbility::GetInstance().Back(); } else if (strcmp(view.GetViewId(), REBOOTDEVICE_VIEW) == 0) { @@ -131,8 +132,9 @@ namespace OHOS // 如果是power键,且是亮屏状态,按键释放就返回上一级 if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0) { - uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); - NativeAbility::GetInstance().ChangeSlice(preSlice); + // uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + // NativeAbility::GetInstance().ChangeSlice(preSlice); + NativeAbility::GetInstance().Back(); } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootView.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootView.cpp index 88f3ed29a..8e5c9c974 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootView.cpp @@ -140,7 +140,9 @@ namespace OHOS } } rebootButton->SetPosition(69, 147, 110, 110); // 69:x 147:y 110:width 110:height - rebootButton->SetImageSrc(PNG_REBOOT_BUTTON_IMAGE, PNG_REBOOT_BUTTON_IMAGE); + rebootButton->SetImageSrc(PNG_SETTINGS_SETTTING_REBOOT, PNG_SETTINGS_SETTTING_REBOOT); + rebootButton->SetImagePosition(36, 36); + rebootButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c); rebootButton->SetViewId(REBOOT_BUTTON); UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance(); if (clickListener == nullptr) @@ -180,7 +182,9 @@ namespace OHOS } } shutdownButton->SetPosition(275, 147, 110, 110); // 275:x 147:y 110:width 110:height - shutdownButton->SetImageSrc(PNG_SHUTDOWN_BUTTON_IMAGE, PNG_SHUTDOWN_BUTTON_IMAGE); + shutdownButton->SetImageSrc(PNG_SETTINGS_SETTTING_SHUTDOWN, PNG_SETTINGS_SETTTING_SHUTDOWN); + shutdownButton->SetImagePosition(36, 36); + shutdownButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffff5a36); shutdownButton->SetViewId(SHUTDOWN_BUTTON); UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance(); if (clickListener == nullptr) diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/ShutdownDeviceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/ShutdownDeviceView.cpp index 4881c02d5..a56f9fdae 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/ShutdownDeviceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/ShutdownDeviceView.cpp @@ -64,7 +64,9 @@ bool ShutdownDeviceView::ShowUpShutdownDeviceView() } } shutdownDeviceButton->SetPosition(172, 147, 110, 110); // 172:x 147:y 110:width 110:height - shutdownDeviceButton->SetImageSrc(PNG_SHUTDOWN_BUTTON_IMAGE, PNG_SHUTDOWN_BUTTON_IMAGE); + shutdownDeviceButton->SetImageSrc(PNG_SETTINGS_SETTTING_SHUTDOWN, PNG_SETTINGS_SETTTING_SHUTDOWN); + shutdownDeviceButton->SetImagePosition(36, 36); + shutdownDeviceButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffff5a36); shutdownDeviceButton->SetViewId(SHUTDOWNDEVICE_BUTTON); UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance(); if (clickListener == nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_desktop/include/SetDesktopPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/set_desktop/include/SetDesktopPresenter.h index 1e8d0c19f..e1fe726a6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_desktop/include/SetDesktopPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/set_desktop/include/SetDesktopPresenter.h @@ -1,3 +1,10 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-08 16:43:48 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-24 16:37:10 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_desktop/include/SetDesktopPresenter.h + */ /* * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. * Description: SetDesktopPresenter.h @@ -8,6 +15,7 @@ #ifndef SET_DESKTOP_PRESENTER_H #define SET_DESKTOP_PRESENTER_H +#include "View.h" #include "Presenter.h" #include "components/ui_view.h" @@ -19,17 +27,21 @@ class SetDesktopView; class SetDesktopModel; class SetDesktopPresenter : public Presenter, public UIView::OnClickListener, + public RootView::OnKeyActListener, public UIView::OnDragListener { public: SetDesktopPresenter(); virtual ~SetDesktopPresenter(); + static SetDesktopPresenter *GetInstance(); virtual void OnStart() override; virtual void OnResume() override; virtual void OnStop() override; bool OnClick(UIView &view, const ClickEvent &event) override; - virtual bool OnDrag(UIView& view, const DragEvent& event) override; + bool OnDrag(UIView& view, const DragEvent& event) override; + bool OnKeyAct(UIView &view, const KeyEvent &event) override; // 增加按键事件 + bool GetHexagonsStyleState(void); private: diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/SetDesktopPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/SetDesktopPresenter.cpp index 0c361bcb1..cadd1c796 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/SetDesktopPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/SetDesktopPresenter.cpp @@ -1,3 +1,10 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-08 16:43:48 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-25 09:24:59 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/SetDesktopPresenter.cpp + */ /* * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. * Description: SettingPresenter.cpp @@ -8,14 +15,27 @@ #include "SetDesktopView.h" #include "SetDesktopModel.h" #include "SetDesktopPresenter.h" +#include "common/key_code.h" +#include namespace OHOS { + + static SetDesktopPresenter *g_pSetDesktopPresenter = nullptr; + SetDesktopPresenter::SetDesktopPresenter() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopPresenter::SetDesktopPresenter"); + g_pSetDesktopPresenter=this; } - SetDesktopPresenter::~SetDesktopPresenter() {} + SetDesktopPresenter::~SetDesktopPresenter() { + g_pSetDesktopPresenter = nullptr; + } + + SetDesktopPresenter *SetDesktopPresenter::GetInstance() + { + return g_pSetDesktopPresenter; + } void SetDesktopPresenter::OnStart() { @@ -37,8 +57,9 @@ namespace OHOS { if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) && (event.GetDeltaX() > X_DRAG_OFFSET) && (event.GetDeltaX() > (DOUBLES * MATH_ABS(event.GetDeltaY())))) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingPresenter::OnDrag ChangeSlice"); - uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); - NativeAbility::GetInstance().ChangeSlice(preSlice); + // uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + // NativeAbility::GetInstance().ChangeSlice(preSlice); + NativeAbility::GetInstance().Back(); } return false; } @@ -51,12 +72,25 @@ namespace OHOS { } else if (strcmp(view.GetViewId(), SET_DESKTOP_LIST) == 0) { SetDesktopModel::GetInstance().SetDesktopStyle(APPLIST_STYLE); } - uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); - NativeAbility::GetInstance().ChangeSlice(preSlice); + // uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); + NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); return true; } bool SetDesktopPresenter::GetHexagonsStyleState(void) { return (SetDesktopModel::GetInstance().GetDesktopStyle() == HEXAGONS_STYLE); } + + bool SetDesktopPresenter::OnKeyAct(UIView &view, const KeyEvent &event) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetDesktopPresenter::OnKeyAct"); + uint16 keyID = event.GetKeyId(); + uint16 keyState = event.GetState(); + // 如果是power键就返回上一级 + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0) + { + NativeAbility::GetInstance().Back(); + } + return true; + } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/SetDesktopView.cpp b/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/SetDesktopView.cpp index c5f2b49df..9609c70a5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/SetDesktopView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/SetDesktopView.cpp @@ -29,6 +29,10 @@ void SetDesktopView::OnStart() container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); container_->SetOnDragListener(presenter_); container_->SetTouchable(true); + + // 增加按键监听 + RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::SetDesktopPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); } void SetDesktopView::OnSetUpView() diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp index bf2836d41..e37684baa 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-27 19:48:49 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-23 19:26:32 + * @LastEditTime: 2024-04-24 16:19:53 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp */ @@ -14,16 +14,24 @@ namespace OHOS { static constexpr int16_t SETTING_ICON_X = 19; static constexpr int16_t SETTING_SICON_Y = 19; - static constexpr int16_t SETTING_SLABEL_X = 115; - static constexpr int16_t SETTING_SLABEL_Y = 33; - static constexpr int16_t SETTING_SLABEL_W = 200; - static constexpr int16_t SETTING_SLABEL_H = 40; - static constexpr int16_t SETTING_SNEXTIMAGE_X = 326; - static constexpr int16 SETTING_SLABEL_FONT_SIZE = 30; - static constexpr int16 SETTING_SLABEL_FONT_HEIGHT = 36; - static constexpr int16 SETTING_SBACKGROUND_HEIGHT = 100; - static constexpr int16 NUMS_2 = 2; + static constexpr int16_t SETTING_SICON_W = 62; + static constexpr int16_t SETTING_SICON_H = 62; + static constexpr int16_t SETTINGLABELEXT_X = 115; + static constexpr int16_t SETTINGLABELEXT_Y = 33; + static constexpr int16_t SETTINGLABELEXT_W = 180; + static constexpr int16_t SETTINGLABELEXT_H = 40; + static constexpr int16_t SETTINGLABELEXT_TEXT_FONT = 30; + static constexpr int16_t SETTINGLABELEXT_LINE_HEIGHT = 35; + static constexpr int16_t SETTINGLABELEXT_ROLLSPEED = 40; + + static constexpr int16_t SETTINGLABELBUTTONEXT_X = 0; + static constexpr int16_t SETTINGLABELBUTTONEXT_Y = 0; + static constexpr int16_t SETTINGLABELBUTTONEXT_W = 380; + static constexpr int16_t SETTINGLABELBUTTONEXT_H = 100; + static constexpr int16_t SETTINGLABELBUTTONEXT_TEXT_FONT = 30; + static constexpr int16_t SETTINGLABELBUTTONEXT_LINE_HEIGHT = 35; + SettingItemView::SettingItemView() { SetPosition(0, 120, 380, 120); @@ -47,26 +55,29 @@ namespace OHOS { sItemInfo = itemInfo; Icon.SetSrc(itemInfo.icon); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%d", itemInfo.textId); + //WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%d", itemInfo.textId); settingLabelExt.SetTextId(itemInfo.textId); } void SettingItemView::SetUpChild() { - Icon.SetPosition(SETTING_ICON_X, SETTING_SICON_Y); + Icon.SetPosition(SETTING_ICON_X, SETTING_SICON_Y,SETTING_SICON_W,SETTING_SICON_H); Icon.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); + Icon.SetAutoEnable(false); + Icon.SetResizeMode(UIImageView::FILL); + Icon.SetStyle(STYLE_BORDER_RADIUS,100); - settingLabelExt.SetPosition(115, 33,180,100); - settingLabelExt.SetStyle(STYLE_TEXT_FONT, 30); - settingLabelExt.SetStyle(STYLE_LINE_HEIGHT, 35); + settingLabelExt.SetPosition(SETTINGLABELEXT_X, SETTINGLABELEXT_Y, SETTINGLABELEXT_W, SETTINGLABELEXT_H); + settingLabelExt.SetStyle(STYLE_TEXT_FONT, SETTINGLABELEXT_TEXT_FONT); + settingLabelExt.SetStyle(STYLE_LINE_HEIGHT, SETTINGLABELEXT_LINE_HEIGHT); settingLabelExt.SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); - settingLabelExt.SetRollSpeed(40); - settingLabelExt.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + settingLabelExt.SetRollSpeed(SETTINGLABELEXT_ROLLSPEED); + settingLabelExt.SetFont(DEFAULT_VECTOR_FONT_FILENAME, SETTINGLABELEXT_TEXT_FONT); - settingLabelButtonExt.SetPosition(0, 0, 380, 100); + settingLabelButtonExt.SetPosition(SETTINGLABELBUTTONEXT_X, SETTINGLABELBUTTONEXT_Y, SETTINGLABELBUTTONEXT_W, SETTINGLABELBUTTONEXT_H); settingLabelButtonExt.SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); - settingLabelButtonExt.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); - settingLabelButtonExt.SetStyle(STYLE_LINE_HEIGHT, 35); + settingLabelButtonExt.SetFont(DEFAULT_VECTOR_FONT_FILENAME, SETTINGLABELBUTTONEXT_TEXT_FONT); + settingLabelButtonExt.SetStyle(STYLE_LINE_HEIGHT, SETTINGLABELBUTTONEXT_LINE_HEIGHT); settingLabelButtonExt.SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED); settingLabelButtonExt.SetAlign(TEXT_ALIGNMENT_LEFT); settingLabelButtonExt.SetLabelPosition(115, 0); 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 79c3862c6..251c6ed55 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 18:09:47 + * @LastEditTime: 2024-04-25 09:12:06 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp */ #include "SettingModel.h" @@ -22,14 +22,15 @@ namespace OHOS void SettingModel::InitSettingItem() { - settings[0] = {SETTING_ITEM_ZERO, PNG_SETTINGS_DISPLAY_BRIGHTNESS, STR_SCREEN_AND_BRIGHTNESS, true}; - settings[1] = {SETTING_ITEM_ONE, PNG_SETTINGS_NETWORKANDCALL, STR_NETWORKANDCALL, true}; - 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[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}; + int settingLen = 0; + settings[settingLen++] = {SETTING_ITEM_ZERO, PNG_SETTINGS_DISPLAY_BRIGHTNESS, STR_SCREEN_AND_BRIGHTNESS, true}; + settings[settingLen++] = {SETTING_ITEM_ONE, PNG_SETTINGS_NETWORKANDCALL, STR_NETWORKANDCALL, true}; + settings[settingLen++] = {SETTING_ITEM_TWO, PNG_SETTINGS_BLUETOOTH, STR_BLUETOOTH, true}; + settings[settingLen++] = {SETTING_ITEM_THREE, PNG_SETTINGS_SOUND_VIBRATION, STR_SOUND_AND_VIBRATION, true}; + settings[settingLen++] = {SETTING_ITEM_FOUR, PNG_SETTINGS_DISPLAY_MODE, STR_DISPLAY_MODE, true}; + settings[settingLen++] = {SETTING_ITEM_FIVE, PNG_SETTINGS_MOTION_RECOGNITION, STR_MOTION_RECOGNITION, true}; + settings[settingLen++] = {SETTING_ITEM_SIX, PNG_SETTINGS_SYSTEM, STR_SYSTEM, true}; + settings[settingLen++] = {SETTING_ITEM_SEVEN, PNG_SETTINGS_SHUTDOWN_AND_RESTART, 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)); diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_POWER_CONTROL.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_POWER_CONTROL.bin deleted file mode 100644 index daeb8abb1b1832dcc4237ede2317957f52ea14ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2840 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 literal 0 HcmV?d00001 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTTING_REBOOT.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTTING_REBOOT.bin new file mode 100644 index 0000000000000000000000000000000000000000..adae54c1d0bc5dd32b57ec1305e81fcb9d075449 GIT binary patch literal 1144 zcmb_bPe>F|9RAIp-F>UBzFkFy(tYb67=vm_smRC~S52dXZ$*Mi5+Z1!gIkG7#*C@8 zOA#1ex@}NwcCuTYoc>?e5X4He-tcW&n=k-SLG94oF_f8+bZ@%w)@An(f02F?h zgp^!=Gwjq>k!{xw*3yHq^7FE&%J!&sG7JOr`=70;#y7`hU7C^Tl*97N&j+{pAH_%_ zSchaYV*r?7Nw6@G^&zpZNzWApCt&*F!o89p=Q{f7J;Rf}V?b-q2^?E`J*bobBvOjf zMbIYr7C=kd0zk0y0aI^9L047}>a8 zbschA%XPtu!a8G>wVY=p(*b_})ht%yRbuxiK5pfRKvpGVb6vp`e9>s35E|R#OlnDn@ktqS7!8J#84pX|H*b%f_H<@uGlyKCQzE0-H>He2WZYi`B8 Ge!l_Gcek7X literal 0 HcmV?d00001 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTTING_SHUTDOWN.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTTING_SHUTDOWN.bin new file mode 100644 index 0000000000000000000000000000000000000000..615b3fda225510297bd0bf57c2bd65b63802d9d4 GIT binary patch literal 1144 zcmb7D-%C?*6#snhuHLUR)}78=R@)t#++xuB1!BU!cULMO3b#GsXl$&I7Y8;{BNl-v-10^y`P@+tDOoh z03sd%*Ysq)`az-@97(-2ALFULU#!@c&yt)W)AwdzEP{x7V*~$71Lt9`4WdMHWxf>? zHFtKEOKYSpA=4Xbu;aTER7^|@^V$HL}9p+v|PR!G?zOvTKR{FBz+kJgX%JV9iUU?=20wMZe z5B1hP^=q$l&VmGPWc;SU6gfV1A#Z?*W(P0