* @Author: luozheng 1732036298@qq.com
* @Date: 2024-03-22 10:04:36
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-09-29 14:36:41
+ * @LastEditTime: 2024-10-08 16:33:30
* @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/src/notify/pairing_notification.cpp
*/
#include "notification_manager.h"
#include <custom_runtime.h>
#include "../../../../../../drivers/peripheral/vibrator/service/vibrator_service.h"
#include <ui_service.h>
-
+#include "rebootandshutdown/include/ShutDownImageAnimatorView.h"
namespace OHOS
{
UIViewGroup *DeviceBindingView{nullptr};
UIButton *DeviceUnbindingRequestButtonOK{nullptr}; // 设备解除绑定请求(与新设备连接)确认
UIButton *DeviceUnbindingRequestButtonCancel{nullptr}; // 设备解除绑定请求(与新设备连接)取消
+ ShutDownImageAnimatorView *p_ShutDownImageAnimatorView{nullptr}; // 关机动画
+ UIViewGroup *ShutDownImageAnimatorGroupView{nullptr};
+
PairingViewEventListener::PairingViewEventListener()
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PairingViewEventListener::PairingViewEventListener");
else if (&view == DeviceUnbindingRequestButtonOK) // 设备解除绑定请求(与新设备连接)确认
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PairingViewEventListener:: DeviceUnbindingRequestButtonOK OnClick");
- // 关闭通知界面
-#ifdef SUPPORT_BLE_SERVICE
- cleanUnbindInfor(1);
-#endif
- NotificationManager::GetInstance()->StopNotify();
+ if (p_ShutDownImageAnimatorView == nullptr)
+ {
+ p_ShutDownImageAnimatorView = new ShutDownImageAnimatorView();
+ if (p_ShutDownImageAnimatorView == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "p_ShutDownImageAnimatorView new fail!!");
+ return false;
+ }
+ ShutDownImageAnimatorGroupView = p_ShutDownImageAnimatorView->ShutDownAnimatorViewInit();
+ if (ShutDownImageAnimatorGroupView == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShutDownImageAnimatorGroupView new fail!!");
+ return false;
+ }
+ DeviceUnbindingRequestGroupView->SetVisible(false);
+ RootView::GetInstance()->Add(ShutDownImageAnimatorGroupView);
+ }
+ ShutDownImageAnimatorView::GetInstance()->ShutDownImageAnimator_Start(3);
}
else if (&view == DeviceUnbindingRequestButtonCancel) // 设备解除绑定请求(与新设备连接)取消
{
DeviceBindingView->Add(DeviceBindingScrollView);
}
- //震动一次
+ // 震动一次
if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()))
{
ui_api_vibrate_once_func();
ScreenTurnOn(40 * 1000); // 亮屏操作 40秒关闭
- PairingViewEventListener::GetInstance().Pairing_StartTimer(); //开启一个40s后弹窗自动销毁定时器
+ PairingViewEventListener::GetInstance().Pairing_StartTimer(); // 开启一个40s后弹窗自动销毁定时器
NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeDeviceBindingView);
return DeviceBindingView;
ScreenTurnOn(40 * 1000); // 亮屏操作 40秒关闭
- PairingViewEventListener::GetInstance().Pairing_StartTimer(); //开启一个40s后弹窗自动销毁定时器
+ PairingViewEventListener::GetInstance().Pairing_StartTimer(); // 开启一个40s后弹窗自动销毁定时器
/* -------------------------------------------------------------------------- */
NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeDeviceUnBindingView);
DeviceUnbindingRequestGroupView = nullptr;
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[FreeDeviceUnbindingRequestGroupView] success");
}
+ if (p_ShutDownImageAnimatorView != nullptr)
+ {
+ RootView::GetInstance()->Remove(ShutDownImageAnimatorGroupView);
+ delete p_ShutDownImageAnimatorView;
+ p_ShutDownImageAnimatorView;
+ }
}
/* -------------------------------------------------------------------------- */