!38338 修复Refresh组件refreshingContent属性置为undefined时默认刷新效果异常的问题

Merge pull request !38338 from zhangDH/refresh
This commit is contained in:
openharmony_ci 2024-07-20 14:32:08 +00:00 committed by Gitee
commit f80793b3ae
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 23 additions and 8 deletions

View File

@ -82,6 +82,19 @@ void RefreshPattern::OnAttachToFrameNode()
host->GetRenderContext()->UpdateClipEdge(true);
}
bool RefreshPattern::OnDirtyLayoutWrapperSwap(
const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config)
{
if (isRemoveCustomBuilder_) {
UpdateFirstChildPlacement();
if (isRefreshing_) {
UpdateLoadingProgressStatus(RefreshAnimationState::RECYCLE, GetFollowRatio());
}
isRemoveCustomBuilder_ = false;
}
return false;
}
void RefreshPattern::OnModifyDone()
{
Pattern::OnModifyDone();
@ -308,11 +321,8 @@ void RefreshPattern::InitChildNode()
if (Container::GreatOrEqualAPIVersion(PlatformVersion::VERSION_ELEVEN)) {
auto progressContext = progressChild_->GetRenderContext();
CHECK_NULL_VOID(progressContext);
UpdateFirstChildPlacement();
if (isRefreshing_) {
UpdateLoadingProgressStatus(RefreshAnimationState::RECYCLE, GetFollowRatio());
}
UpdateLoadingTextOpacity(1.0f);
progressContext->UpdateOpacity(0.0f);
UpdateLoadingTextOpacity(0.0f);
} else {
UpdateLoadingProgress();
}
@ -523,9 +533,12 @@ void RefreshPattern::AddCustomBuilderNode(const RefPtr<NG::UINode>& builder)
auto host = GetHost();
CHECK_NULL_VOID(host);
if (!builder) {
host->RemoveChild(customBuilder_);
isCustomBuilderExist_ = false;
customBuilder_ = nullptr;
if (isCustomBuilderExist_) {
host->RemoveChild(customBuilder_);
isCustomBuilderExist_ = false;
customBuilder_ = nullptr;
isRemoveCustomBuilder_ = true;
}
return;
}

View File

@ -105,6 +105,7 @@ public:
}
private:
bool OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config) override;
void InitPanEvent(const RefPtr<GestureEventHub>& gestureHub);
void HandleDragStart(bool isDrag = true, float mainSpeed = 0.0f);
ScrollResult HandleDragUpdate(float delta, float mainSpeed = 0.0f);
@ -156,6 +157,7 @@ private:
bool isRefreshing_ = false;
bool isKeyEventRegisted_ = false;
bool hasLoadingText_ = false;
bool isRemoveCustomBuilder_ = false;
RefPtr<FrameNode> progressChild_;
RefPtr<FrameNode> loadingTextNode_;
RefPtr<FrameNode> columnNode_;