屏蔽开发调试窗口点击intemview index = 0 事件 1082/2
authorluozheng <1732036298@qq.com>
Thu, 3 Oct 2024 06:50:55 +0000 (14:50 +0800)
committerluozheng <1732036298@qq.com>
Thu, 3 Oct 2024 06:50:55 +0000 (14:50 +0800)
code/sdk/application/wearable/fd230app/nativeui/watchQRcode/src/WatchQRCodePresenter.cpp
code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp

index f732f98..804feaf 100644 (file)
@@ -8,7 +8,7 @@
 #include "UiConfig.h"
 #include <graphic_math.h>
 #include "bleService.h"
-
+#include "broadcast_feature.h"
 namespace OHOS
 {
     // 当前Presenter属性实例化的内存指针
@@ -48,6 +48,8 @@ namespace OHOS
         return;
     }
 
+    static uint32_t time = 0;
+    static uint32_t OnClick_num = 0;
     bool WatchQRCodePresenter::OnClick(UIView &view, const ClickEvent &event)
     {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "WatchQRCodePresenter::OnDrag");
@@ -56,7 +58,31 @@ namespace OHOS
         if (viewId == WATCHQRCODEVIEWID)
         {
             if (view_)
+            {
                 view_->start_refresh_timer();
+            }
+            if (time == 0)
+            {
+                time = event.GetTimeStamp();
+                OnClick_num = 1;
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "222  %d", time);
+            }
+            else
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "111   %d", event.GetTimeStamp());
+                if (event.GetTimeStamp() - time < 2000)
+                {
+                    OnClick_num++;
+                    if (OnClick_num > 5)
+                    {
+                        CustomEventPublish(TOPIC_EVENT_DEBUGOUTPUT, NULL, 0);
+                    }
+                }
+                else
+                {
+                    time = 0;
+                }
+            }
         }
 
         return true;
index 14ed910..5b6af59 100644 (file)
@@ -147,6 +147,10 @@ namespace OHOS
             DebugOutputItemView *debugOutputItemView = static_cast<DebugOutputItemView *>(&view);
             viewIndex = debugOutputItemView->GetViewIndex();
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "viewIndex:%d", viewIndex);
+            if (viewIndex == 0)
+            {
+                return true;
+            }
             ChangeView(0, 1);
             SetCurViewIndex(viewIndex);
         }
@@ -194,7 +198,7 @@ namespace OHOS
             int16_t deltaY;
             deltaX = event.GetDeltaX();
             deltaY = event.GetDeltaY();
-            if (MATH_ABS(deltaX) >= MATH_ABS(deltaY) && MATH_ABS(deltaX) > 30)
+            if (MATH_ABS(deltaX) >= MATH_ABS(deltaY) && MATH_ABS(deltaX) > 20)
             {
                 X_DRAG_FLAG = true;
             }