From 86a16c0f92eb2d92f89d1cb7ff12d7df55efc23d Mon Sep 17 00:00:00 2001 From: qianqiuhong Date: Fri, 27 Sep 2024 11:26:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E6=80=81=E6=A0=B7=E5=BC=8F=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E7=84=A6=E7=82=B9=E6=97=A5=E5=BF=97=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qianqiuhong --- .../core/components_ng/event/focus_hub.cpp | 18 ++++++++++++++---- .../event/state_style_manager.cpp | 18 ++++++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/frameworks/core/components_ng/event/focus_hub.cpp b/frameworks/core/components_ng/event/focus_hub.cpp index abcbd0fa7bd..c9340c82e2a 100644 --- a/frameworks/core/components_ng/event/focus_hub.cpp +++ b/frameworks/core/components_ng/event/focus_hub.cpp @@ -350,11 +350,11 @@ void FocusHub::LostFocusToViewRoot() CHECK_NULL_VOID(curFocusView); auto viewRootScope = curFocusView->GetViewRootScope(); CHECK_NULL_VOID(viewRootScope); - TAG_LOGI(AceLogTag::ACE_FOCUS, "Lost focus to view root: %{public}s/%{public}d", - viewRootScope->GetFrameName().c_str(), viewRootScope->GetFrameId()); + TAG_LOGI(AceLogTag::ACE_FOCUS, "Lost focus to view root: %{public}s", + viewRootScope->GetFrameName().c_str()); if (!viewRootScope->IsCurrentFocus()) { - TAG_LOGI(AceLogTag::ACE_FOCUS, "View root: %{public}s/%{public}d is not on focusing.", - viewRootScope->GetFrameName().c_str(), viewRootScope->GetFrameId()); + TAG_LOGI(AceLogTag::ACE_FOCUS, "View root: %{public}s is not on focusing.", + viewRootScope->GetFrameName().c_str()); return; } curFocusView->SetIsViewRootScopeFocused(true); @@ -2106,7 +2106,11 @@ bool FocusHub::RequestFocusImmediatelyById(const std::string& id, bool isSyncReq CHECK_NULL_RETURN(focusManager, false); auto focusNode = GetChildFocusNodeById(id); if (!focusNode) { +#ifdef IS_RELEASE_VERSION + TAG_LOGI(AceLogTag::ACE_FOCUS, "Request focus id can not found."); +#else TAG_LOGI(AceLogTag::ACE_FOCUS, "Request focus id: %{public}s can not found.", id.c_str()); +#endif focusManager->TriggerRequestFocusCallback(RequestFocusResult::NON_EXIST); return false; } @@ -2114,9 +2118,15 @@ bool FocusHub::RequestFocusImmediatelyById(const std::string& id, bool isSyncReq if ((isSyncRequest && !focusNode->IsSyncRequestFocusable()) || (!isSyncRequest && !focusNode->IsFocusable())) { result = false; } +#ifdef IS_RELEASE_VERSION TAG_LOGI(AceLogTag::ACE_FOCUS, "Request focus immediately %{public}s by id: %{public}s. The node is %{public}s/%{public}d.", isSyncRequest ? "sync" : "async", id.c_str(), focusNode->GetFrameName().c_str(), focusNode->GetFrameId()); +#else + TAG_LOGI(AceLogTag::ACE_FOCUS, + "Request focus immediately %{public}s by id. The node is %{public}s/%{public}d.", + isSyncRequest ? "sync" : "async", focusNode->GetFrameName().c_str(), focusNode->GetFrameId()); +#endif if (result || !isSyncRequest) { pipeline->AddDirtyRequestFocus(focusNode->GetFrameNode()); if (isSyncRequest) { diff --git a/frameworks/core/components_ng/event/state_style_manager.cpp b/frameworks/core/components_ng/event/state_style_manager.cpp index c9681ba7054..91a7e7c7661 100644 --- a/frameworks/core/components_ng/event/state_style_manager.cpp +++ b/frameworks/core/components_ng/event/state_style_manager.cpp @@ -65,8 +65,8 @@ const RefPtr& StateStyleManager::GetPressedListener() int32_t sourceType = static_cast(touches.front().GetSourceDevice()); if (stateStyleMgr->IsOutOfPressedRegion(sourceType, lastPoint.GetGlobalLocation())) { auto frameNode = stateStyleMgr->GetFrameNode(); - TAG_LOGI(AceLogTag::ACE_STATE_STYLE, "Move out of node pressed region: %{public}s/%{public}d", - frameNode->GetTag().c_str(), frameNode->GetId()); + TAG_LOGI(AceLogTag::ACE_STATE_STYLE, "Move out of node pressed region: %{public}s", + frameNode->GetTag().c_str()); stateStyleMgr->pointerId_.erase(lastPoint.GetFingerId()); if (stateStyleMgr->pointerId_.size() == 0) { stateStyleMgr->ResetPressedState(); @@ -81,8 +81,12 @@ const RefPtr& StateStyleManager::GetPressedListener() void StateStyleManager::HandleTouchDown() { +#ifdef IS_RELEASE_VERSION + TAG_LOGI(AceLogTag::ACE_STATE_STYLE, "Handle TouchDown event node: %{public}s", GetFrameNode()->GetTag().c_str()); +#else TAG_LOGI(AceLogTag::ACE_STATE_STYLE, "Handle TouchDown event node: %{public}s/%{public}d", GetFrameNode()->GetTag().c_str(), GetFrameNode()->GetId()); +#endif HandleScrollingParent(); if (!hasScrollingParent_) { UpdateCurrentUIState(UI_STATE_PRESSED); @@ -98,8 +102,13 @@ void StateStyleManager::HandleTouchDown() void StateStyleManager::HandleTouchUp() { +#ifdef IS_RELEASE_VERSION + TAG_LOGI(AceLogTag::ACE_STATE_STYLE, "Handle TouchUp or Cancel event node: %{public}s", + GetFrameNode()->GetTag().c_str()); +#else TAG_LOGI(AceLogTag::ACE_STATE_STYLE, "Handle TouchUp or Cancel event node: %{public}s/%{public}d", GetFrameNode()->GetTag().c_str(), GetFrameNode()->GetId()); +#endif if (IsPressedStatePending()) { DeletePressStyleTask(); ResetPressedPendingState(); @@ -120,8 +129,13 @@ void StateStyleManager::FireStateFunc(bool isReset) auto node = GetFrameNode(); CHECK_NULL_VOID(node); auto nodeId = node->GetId(); +#ifdef IS_RELEASE_VERSION + TAG_LOGI(AceLogTag::ACE_STATE_STYLE,"Start execution, node is %{public}s, " + "reset is %{public}d", node->GetTag().c_str(), isReset); +#else TAG_LOGI(AceLogTag::ACE_STATE_STYLE, "Start execution, node is %{public}s/%{public}d, " "reset is %{public}d", node->GetTag().c_str(), nodeId, isReset); +#endif RefPtr customNode; GetCustomNode(customNode, node); if (!customNode) {