通过设置拦截函数优化连接状态视图的退出逻辑
authorluozheng <1732036298@qq.com>
Sat, 27 Apr 2024 09:54:17 +0000 (17:54 +0800)
committerluozheng <1732036298@qq.com>
Sat, 27 Apr 2024 09:54:17 +0000 (17:54 +0800)
code/sdk/application/wearable/fd230app/nativeui/main/src/ConnectedStatusView.cpp

index 96f4403..4ea6fbd 100644 (file)
@@ -38,13 +38,13 @@ namespace OHOS
             for (int i = 0; i < MAX_CONNECTEDSTATUS_ID; i++)
             {
                 delete background[i];
-                background[i];
+                background[i] = nullptr;
 
                 delete PhoneAndEarAndBluetooth[i];
-                PhoneAndEarAndBluetooth[i];
+                PhoneAndEarAndBluetooth[i] = nullptr;
 
                 delete ConnectedStatusLabel[i];
-                ConnectedStatusLabel[i];
+                ConnectedStatusLabel[i] = nullptr;
             }
 
             delete PhoneConnectedStatusImage;
@@ -145,6 +145,9 @@ namespace OHOS
             }
             group->SetPosition(0, 0, 466, 466);
             group->SetViewIndex(1);
+            group->SetTouchable(true);
+            group->SetDraggable(true);
+            group->SetIntercept(true);
             /* -------------------------------------------------------------------------- */
             LabelConfig titleConfig = {93, 53, 280, 35, 30, 35, "连接状态"};
             Title = InitLabel(titleConfig);