多态样式以及焦点日志整改

Signed-off-by: qianqiuhong <qianqiuhong@huawei.com>
This commit is contained in:
qianqiuhong 2024-09-27 11:26:27 +08:00
parent 05f1847d41
commit 86a16c0f92
2 changed files with 30 additions and 6 deletions

View File

@ -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) {

View File

@ -65,8 +65,8 @@ const RefPtr<TouchEventImpl>& StateStyleManager::GetPressedListener()
int32_t sourceType = static_cast<int32_t>(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<TouchEventImpl>& 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<CustomNodeBase> customNode;
GetCustomNode(customNode, node);
if (!customNode) {