From 2154fce6ef36a8f199ca10b66ecbe5ddfb7197c7 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 28 Jan 2026 17:28:12 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3=E5=A3=B0=E9=9F=B3=E4=B8=8E?= =?utf8?q?=E9=9C=87=E5=8A=A8=E7=95=8C=E9=9D=A2=E6=81=AF=E5=B1=8F=E5=90=8E?= =?utf8?q?=E6=BB=91=E5=8A=A8=E7=9B=91=E5=90=AC=E5=A4=B1=E6=95=88=E9=97=AE?= =?utf8?q?=E9=A2=98=EF=BC=9B=E8=BF=90=E5=8A=A8=E8=AF=86=E5=88=AB=E5=BC=B9?= =?utf8?q?=E7=AA=97=E9=9C=87=E5=8A=A8=E4=B8=A4=E6=AC=A1=EF=BC=8C=E9=BB=98?= =?utf8?q?=E8=AE=A4=E5=BC=BA=E5=BA=A6=E8=AE=BE=E7=BD=AE=E4=B8=BA=E5=BC=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../include/SoundAndVibrationView.h | 1 + .../soundandvibration/src/CallVolumeView.cpp | 5 +--- .../src/SoundAndVibrationView.cpp | 27 ++++++++++++++----- .../src/SystemVolumeView.cpp | 5 +--- .../motion_recognition_notification.cpp | 1 + code/sdk/zhihui/config/include/ConfigModel.h | 2 +- 6 files changed, 26 insertions(+), 15 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/include/SoundAndVibrationView.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/include/SoundAndVibrationView.h index 7922a1c02..2e296723c 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/include/SoundAndVibrationView.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/include/SoundAndVibrationView.h @@ -83,6 +83,7 @@ namespace OHOS bool InitSoundAndVibrationToggleButton(void); private: + UIViewGroup *group{nullptr}; UIScrollView *SoundAndVibrationScrollView[MAX_SOUNDANDVIBRATIONVIEWID]{nullptr}; UILabelExt *Title{nullptr}; // 标题:“声音与震动” // UILabelButtonExt *SystemVolumeButton{nullptr}; // 系统音量按钮 diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/CallVolumeView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/CallVolumeView.cpp index cf6910abd..0831a857c 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/CallVolumeView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/CallVolumeView.cpp @@ -63,16 +63,13 @@ namespace OHOS return nullptr; } } + CallVolumeScrollView->SetOnDragListener(presenter_); return CallVolumeScrollView; } void CallVolumeView::OnStart() { - GetRootContainer()->SetTouchable(true); - GetRootContainer()->SetDraggable(true); - GetRootContainer()->SetOnDragListener(presenter_); - if (!initViewStatus) { CallVolumeViewInit(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/SoundAndVibrationView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/SoundAndVibrationView.cpp index 9ab595b11..e97a12a06 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/SoundAndVibrationView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/SoundAndVibrationView.cpp @@ -54,6 +54,10 @@ namespace OHOS if (initViewStatus == true) { + group->RemoveAll(); + delete group; + group = nullptr; + if (SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] != nullptr) { SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]->RemoveAll(); @@ -128,7 +132,7 @@ namespace OHOS FocusManager::GetInstance()->RequestFocus(SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]); FocusManager::GetInstance()->RequestFocusByDirection(FOCUS_DIRECTION_UP); SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]->SetRotateFactor(1.0); - AddViewToRootContainer(SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]); + group->Add(SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW]); return true; } @@ -338,9 +342,20 @@ namespace OHOS void SoundAndVibrationView::OnStart() { - GetRootContainer()->SetTouchable(true); - GetRootContainer()->SetDraggable(true); - GetRootContainer()->SetOnDragListener(presenter_); + if (group == nullptr) + { + group = new UIViewGroup(); + if (group == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group new fail"); + return ; + } + } + group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + group->SetDraggable(true); + group->SetTouchable(true); + group->SetOnDragListener(presenter_); + AddViewToRootContainer(group); if (!initViewStatus) { @@ -354,7 +369,7 @@ namespace OHOS if (SoundAndVibrationScrollView[thisView] == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SoundAndVibrationView::ChangeSoundAndVibrationView"); - AddViewToRootContainer(SoundAndVibrationScrollView[thisView]); + group->Add(SoundAndVibrationScrollView[thisView]); } return true; } @@ -375,7 +390,7 @@ namespace OHOS } } SoundAndVibrationScrollView[thisView] = vibrationModeView->VibrationModeViewInit(); - AddViewToRootContainer(SoundAndVibrationScrollView[thisView]); + group->Add(SoundAndVibrationScrollView[thisView]); } return true; } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/SystemVolumeView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/SystemVolumeView.cpp index 541b56616..873279fda 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/SystemVolumeView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/soundandvibration/src/SystemVolumeView.cpp @@ -74,16 +74,13 @@ namespace OHOS return nullptr; } } + SystemVolumeScrollView->SetOnDragListener(presenter_); return SystemVolumeScrollView; } void SystemVolumeView::OnStart() { - GetRootContainer()->SetTouchable(true); - GetRootContainer()->SetDraggable(true); - GetRootContainer()->SetOnDragListener(presenter_); - if (!initViewStatus) { SystemVolumeViewInit(); diff --git a/code/sdk/application/wearable/fd272/service/msg_center/src/notify/motion_recognition_notification.cpp b/code/sdk/application/wearable/fd272/service/msg_center/src/notify/motion_recognition_notification.cpp index 786ab978e..37cab10d1 100644 --- a/code/sdk/application/wearable/fd272/service/msg_center/src/notify/motion_recognition_notification.cpp +++ b/code/sdk/application/wearable/fd272/service/msg_center/src/notify/motion_recognition_notification.cpp @@ -353,6 +353,7 @@ namespace OHOS if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get())) { custom_VibratorFunc_int(0); + custom_VibratorFunc_int(0); } /* -------------------------------------------------------------------------- */ NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeMotionRecognitionView); diff --git a/code/sdk/zhihui/config/include/ConfigModel.h b/code/sdk/zhihui/config/include/ConfigModel.h index 6ca170ddb..7ba93ba14 100644 --- a/code/sdk/zhihui/config/include/ConfigModel.h +++ b/code/sdk/zhihui/config/include/ConfigModel.h @@ -336,7 +336,7 @@ namespace OHOS {ConfigDataType::DATATYPE_STRING, "language_code", "zh" },//CONFIGMODEL_ITEM_LANGUAGE_CODE, //默认没有选择语言 {ConfigDataType::DATATYPE_INT, "timezone", "32" },//CONFIGMODEL_ITEM_TIMEZONE, //单位刻钟 默认+8 小时 = 4*8 = 32 刻钟 {ConfigDataType::DATATYPE_BOOL, "slient_mode", "false" },//CONFIGMODEL_ITEM_SILENT_MODE, - {ConfigDataType::DATATYPE_INT, "vibrator_switch", "2" },//CONFIGMODEL_ITEM_VIBRATOR_SWITCH, // 马达 开关,3 强,2 中,1 弱,0 关 + {ConfigDataType::DATATYPE_INT, "vibrator_switch", "3" },//CONFIGMODEL_ITEM_VIBRATOR_SWITCH, // 马达 开关,3 强,2 中,1 弱,0 关 {ConfigDataType::DATATYPE_BOOL, "rase2wake", "true" },//CONFIGMODEL_ITEM_RAISE_TO_WAKE, {ConfigDataType::DATATYPE_INT, "stepcount", "0" },//CONFIGMODEL_ITEM_ACTIVITY_VALUES_STEPCOUNT, //活动数据步数 {ConfigDataType::DATATYPE_INT, "calories", "0" },// CONFIGMODEL_ITEM_ACTIVITY_VALUES_CALORIES, //活动数据卡路里, -- 2.17.1