From 4d93136e7fde9a8f75dc47987d91dd4bdc5d8b43 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Thu, 8 Jan 2026 18:05:03 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3=E7=A6=85=E9=81=93=EF=BC=8C163?= =?utf8?q?0=E8=A1=A8=E5=86=A0=E9=97=AE=E9=A2=98=EF=BC=9A=E5=85=85=E7=94=B5?= =?utf8?q?=E5=BC=B9=E7=AA=97=E5=8F=AF=E4=BB=A5=E7=94=A8=E8=A1=A8=E5=86=A0?= =?utf8?q?=E6=8C=89=E4=B8=8B=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../classicbluetooth/src/ClassicBlueToothView.cpp | 2 +- .../msg_center/include/notify/charge_notification.h | 3 +++ .../msg_center/src/notify/charge_notification.cpp | 11 ++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp index d0345aaf5..600035b9f 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/classicbluetooth/src/ClassicBlueToothView.cpp @@ -276,7 +276,7 @@ namespace OHOS BlueToothScrollView->Add(BluetoothServiceOptionsButton); BlueToothScrollView->Add(TradionalBlueToothLabel); BlueToothScrollView->Add(BluetoothServiceOptionsLabel); - BlueToothScrollView->Add(AttentionLabel); + // BlueToothScrollView->Add(AttentionLabel); BlueToothScrollView->Add(TradionalBlueToothToggleButton); AddViewToRootContainer(BlueToothScrollView); } diff --git a/code/sdk/application/wearable/fd272/service/msg_center/include/notify/charge_notification.h b/code/sdk/application/wearable/fd272/service/msg_center/include/notify/charge_notification.h index b37d65be5..43e767600 100644 --- a/code/sdk/application/wearable/fd272/service/msg_center/include/notify/charge_notification.h +++ b/code/sdk/application/wearable/fd272/service/msg_center/include/notify/charge_notification.h @@ -42,6 +42,7 @@ namespace OHOS class lowppowrViewEventListener : public OHOS::UIView::OnClickListener, public OHOS::UIView::OnLongPressListener, public OHOS::UIView::OnTouchListener, + public RootView::OnKeyActListener, public OHOS::UIView::OnDragListener { public: @@ -75,6 +76,8 @@ public: { return true; } + + virtual bool OnKeyAct(UIView &view, const KeyEvent &event) override; }; }; #endif /* CHARGE_NOTIFICATION_H */ \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/service/msg_center/src/notify/charge_notification.cpp b/code/sdk/application/wearable/fd272/service/msg_center/src/notify/charge_notification.cpp index 8208824ea..b33c2d824 100644 --- a/code/sdk/application/wearable/fd272/service/msg_center/src/notify/charge_notification.cpp +++ b/code/sdk/application/wearable/fd272/service/msg_center/src/notify/charge_notification.cpp @@ -56,6 +56,7 @@ namespace OHOS const ImageInfo **ChargeAnimationInfoArray{nullptr}; //充电动画图片路径数组 ImageAnimatorInfo ChargeAnimationInfo[CHARGE_ANIMATION_VIEW_NUM_FRAMES]; //充电动画图像的信息 + static OHOS::RootView::OnKeyActListener *g_onKeyActListener = nullptr; // GILROY_BOLD_FONT //充电中 UI @@ -187,6 +188,7 @@ namespace OHOS ChargeAnimationInfoArray = nullptr; } + RootView::GetInstance()->SetOnKeyActListener(g_onKeyActListener); // if(UILabel_Chargeing) // { // delete UILabel_Chargeing; @@ -313,6 +315,9 @@ namespace OHOS UIViewGroup_charge->Add(chargeAnimatorView); } + g_onKeyActListener = RootView::GetInstance()->GetOnKeyActListener(); + RootView::GetInstance()->SetOnKeyActListener(lowppowrViewEventListener::GetInstance()); + UIViewGroup_charge->Add(UILabel_time); UIViewGroup_charge->Add(UILabel_power); @@ -656,6 +661,10 @@ namespace OHOS } - + bool lowppowrViewEventListener::OnKeyAct(UIView &view, const KeyEvent &event) + { + NotificationManager::GetInstance()->StopNotify(); + return true; + } } -- 2.17.1