From f0e685ed726d5d637a554c39fbdcc727fc149d0f Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Thu, 3 Oct 2024 14:50:55 +0800 Subject: [PATCH] =?utf8?q?=E5=B1=8F=E8=94=BD=E5=BC=80=E5=8F=91=E8=B0=83?= =?utf8?q?=E8=AF=95=E7=AA=97=E5=8F=A3=E7=82=B9=E5=87=BBintemview=20index?= =?utf8?q?=20=3D=200=20=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../watchQRcode/src/WatchQRCodePresenter.cpp | 28 ++++++++++++++++++- .../debug_output_notification.cpp | 6 +++- 2 files changed, 32 insertions(+), 2 deletions(-) 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; } -- 2.17.1