using columnNode_ to judge Whether the text node exists rather than hasLoadingText_

Signed-off-by: Zhang-Dong-hui <zhangdonghui5@huawei.com>
Change-Id: Ic9f8b2fc462830ef4c3a485b8043e39d30b8439d
This commit is contained in:
Zhang-Dong-hui 2024-11-09 03:50:21 +00:00
parent a5c32fd24b
commit 3b667f9f98

View File

@ -576,7 +576,7 @@ void RefreshPattern::AddCustomBuilderNode(const RefPtr<NG::UINode>& builder)
if (!isCustomBuilderExist_) {
if (progressChild_) {
if (hasLoadingText_) {
if (columnNode_) {
host->RemoveChild(columnNode_);
columnNode_ = nullptr;
loadingTextNode_ = nullptr;
@ -742,7 +742,7 @@ void RefreshPattern::UpdateScrollTransition(float scrollOffset)
CHECK_NULL_VOID(host);
int32_t childCount = host->TotalChildCount();
// If the refresh has no children without loadingProgress and text, it does not need to update offset.
if (childCount < 2 || (childCount == 2 && hasLoadingText_)) { // 2 means loadingProgress and text child components.
if (childCount < 2 || (childCount == 2 && columnNode_)) { // 2 means loadingProgress and text child components.
return;
}
// Need to search for frameNode and skip ComponentNode
@ -803,7 +803,7 @@ float RefreshPattern::GetLoadingVisibleHeight()
CHECK_NULL_RETURN(renderContext, 0.0f);
auto geometryNode = progressChild_->GetGeometryNode();
CHECK_NULL_RETURN(geometryNode, 0.0f);
if (hasLoadingText_) {
if (loadingTextNode_) {
auto loadingTextGeometryNode = loadingTextNode_->GetGeometryNode();
CHECK_NULL_RETURN(loadingTextGeometryNode, 0.0f);
loadingHeight = geometryNode->GetFrameSize().Height() + loadingTextGeometryNode->GetFrameSize().Height() +