From: luozheng <1732036298@qq.com> Date: Thu, 8 Jan 2026 10:05:03 +0000 (+0800) Subject: 解决禅道,1630表冠问题:充电弹窗可以用表冠按下关闭 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=4d93136e7fde9a8f75dc47987d91dd4bdc5d8b43;p=mirrors%2FFD230.git 解决禅道,1630表冠问题:充电弹窗可以用表冠按下关闭 --- 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; + } }