From b257d7c28786e853cfcc5665909883a6f265dcb1 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Fri, 13 Mar 2026 16:31:20 +0800 Subject: [PATCH] =?utf8?q?1.AI=E5=B1=8F=E8=94=BD4GAI=EF=BC=8C=E4=BF=AE?= =?utf8?q?=E6=94=B94GAI=E7=9B=B8=E5=85=B3=E4=BF=A1=E6=81=AF=202.=E8=A7=A3?= =?utf8?q?=E5=86=B3=E5=A3=B0=E9=9F=B3=E4=B8=8E=E9=9C=87=E5=8A=A8=E7=95=8C?= =?utf8?q?=E9=9D=A2=E6=81=AF=E5=B1=8F=E5=90=8E=E6=BB=91=E5=8A=A8=E7=9B=91?= =?utf8?q?=E5=90=AC=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/AiVoiceBluetoothFailedStartView.cpp | 4 +++ .../nativeui/aivoice/src/AiVoiceModel.cpp | 9 ++++--- .../nativeui/aivoice/src/AiVoicePresenter.cpp | 1 + .../nativeui/sleep/src/SleepView.cpp | 2 +- .../include/SoundAndVibrationView.h | 1 + .../soundandvibration/src/CallVolumeView.cpp | 6 ++--- .../src/SoundAndVibrationView.cpp | 26 ++++++++++++++----- .../src/SystemVolumeView.cpp | 5 ++-- 8 files changed, 37 insertions(+), 17 deletions(-) diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceBluetoothFailedStartView.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceBluetoothFailedStartView.cpp index 80752ad6b..791c39a9f 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceBluetoothFailedStartView.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceBluetoothFailedStartView.cpp @@ -98,6 +98,10 @@ namespace OHOS label->SetText("中国移动智能助理灵犀"); #endif } + else if(labelconfig.textId == STR_PCY4GC_OR_AS) + { + label->SetText("请打开手机APP连接"); + } else label->SetTextId(labelconfig.textId); label->SetLineBreakMode(labelconfig.lineBreakMode); diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp index b44167ec3..7f6d83481 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp @@ -161,10 +161,11 @@ namespace OHOS // 获取4G网络是否正常 bool AiVoiceModel::GetMobileDataIsOpen(void) { - if (uapi_dev_runtime_get_cat1_networkstat() == 1) - { - return true; - } + //屏蔽4G网络判断 + // if (uapi_dev_runtime_get_cat1_networkstat() == 1) + // { + // return true; + // } return false; } diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp index e1e0f93de..40fba0d53 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -439,6 +439,7 @@ namespace OHOS * 3.只有与APP蓝牙连接正常 -> 通过蓝牙连接APP调用大模型 * 4.两者连接都异常 -> 返回错误 */ + // bool netWork4GState = model->GetMobileDataIsOpen(); bool netWork4GState = model->GetMobileDataIsOpen(); bool appBluetoothConnectState = model->GetAPPBluetoothIsConnect(); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "netWork4GState = %d,appBluetoothConnectState = %d", netWork4GState, appBluetoothConnectState); diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/sleep/src/SleepView.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/sleep/src/SleepView.cpp index b46aff780..c03015f1a 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/sleep/src/SleepView.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/sleep/src/SleepView.cpp @@ -45,7 +45,7 @@ void SleepView::SleepDataRefresh() { return; } - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SleepDataRefresh %d %d sleep_goal:%d total_sleep:%d", sleep_hour, sleep_min, sleep_goal * 60, total_sleep); diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/include/SoundAndVibrationView.h b/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/include/SoundAndVibrationView.h index 7922a1c02..2e296723c 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/include/SoundAndVibrationView.h +++ b/code/sdk/application/wearable/n9/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/n9/nativeapp/nativeui/soundandvibration/src/CallVolumeView.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/CallVolumeView.cpp index cf6910abd..25a5d00b3 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/CallVolumeView.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/CallVolumeView.cpp @@ -63,15 +63,15 @@ namespace OHOS return nullptr; } } + + CallVolumeScrollView->SetOnDragListener(presenter_); return CallVolumeScrollView; } void CallVolumeView::OnStart() { - GetRootContainer()->SetTouchable(true); - GetRootContainer()->SetDraggable(true); - GetRootContainer()->SetOnDragListener(presenter_); + if (!initViewStatus) { diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/SoundAndVibrationView.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/SoundAndVibrationView.cpp index 9ab595b11..a33558efa 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/SoundAndVibrationView.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/SoundAndVibrationView.cpp @@ -53,6 +53,9 @@ namespace OHOS { if (initViewStatus == true) { + group->RemoveAll(); + delete group; + group = nullptr; if (SoundAndVibrationScrollView[SOUNDANDVIBRATIONVIEW] != nullptr) { @@ -128,7 +131,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 +341,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 +368,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 +389,7 @@ namespace OHOS } } SoundAndVibrationScrollView[thisView] = vibrationModeView->VibrationModeViewInit(); - AddViewToRootContainer(SoundAndVibrationScrollView[thisView]); + group->Add(SoundAndVibrationScrollView[thisView]); } return true; } diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/SystemVolumeView.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/SystemVolumeView.cpp index 541b56616..cda5d2ea7 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/SystemVolumeView.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/soundandvibration/src/SystemVolumeView.cpp @@ -74,15 +74,14 @@ namespace OHOS return nullptr; } } + SystemVolumeScrollView->SetOnDragListener(presenter_); return SystemVolumeScrollView; } void SystemVolumeView::OnStart() { - GetRootContainer()->SetTouchable(true); - GetRootContainer()->SetDraggable(true); - GetRootContainer()->SetOnDragListener(presenter_); + if (!initViewStatus) { -- 2.17.1