From: luozheng <1732036298@qq.com> Date: Thu, 3 Oct 2024 06:50:55 +0000 (+0800) Subject: 屏蔽开发调试窗口点击intemview index = 0 事件 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1082%2F2;p=mirrors%2FFD230.git 屏蔽开发调试窗口点击intemview index = 0 事件 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/watchQRcode/src/WatchQRCodePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/watchQRcode/src/WatchQRCodePresenter.cpp index f732f9804..804feaf9a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/watchQRcode/src/WatchQRCodePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/watchQRcode/src/WatchQRCodePresenter.cpp @@ -8,7 +8,7 @@ #include "UiConfig.h" #include #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; diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp index 14ed910fa..5b6af59a4 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp @@ -147,6 +147,10 @@ namespace OHOS DebugOutputItemView *debugOutputItemView = static_cast(&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; }