fix tdd failed

Signed-off-by: Zhang-Dong-hui <zhangdonghui5@huawei.com>
Change-Id: I6eb956a3e06c2268935dacdbf05590e750dee9bc
This commit is contained in:
Zhang-Dong-hui 2024-11-08 10:28:39 +00:00
parent aa0b2e5bd1
commit a5c32fd24b

View File

@ -219,10 +219,6 @@ void RefreshPattern::InitProgressNode()
{
auto host = GetHost();
CHECK_NULL_VOID(host);
auto context = host->GetContext();
CHECK_NULL_VOID(context);
auto theme = context->GetTheme<RefreshTheme>();
CHECK_NULL_VOID(theme);
progressChild_ = FrameNode::CreateFrameNode(V2::LOADING_PROGRESS_ETS_TAG,
ElementRegister::GetInstance()->MakeUniqueId(), AceType::MakeRefPtr<LoadingProgressPattern>());
CHECK_NULL_VOID(progressChild_);
@ -237,9 +233,13 @@ void RefreshPattern::InitProgressNode()
auto progressPaintProperty = progressChild_->GetPaintProperty<LoadingProgressPaintProperty>();
CHECK_NULL_VOID(progressPaintProperty);
progressPaintProperty->UpdateLoadingProgressOwner(LoadingProgressOwner::REFRESH);
progressPaintProperty->UpdateColor(theme->GetProgressColor());
host->AddChild(progressChild_, 0);
progressChild_->MarkDirtyNode();
auto context = host->GetContext();
CHECK_NULL_VOID(context);
auto theme = context->GetTheme<RefreshTheme>();
CHECK_NULL_VOID(theme);
progressPaintProperty->UpdateColor(theme->GetProgressColor());
}
void RefreshPattern::UpdateLoadingTextOpacity(float opacity)
@ -327,6 +327,7 @@ void RefreshPattern::InitChildNode()
if (!progressChild_) {
InitProgressNode();
if (Container::GreatOrEqualAPIVersion(PlatformVersion::VERSION_ELEVEN)) {
CHECK_NULL_VOID(progressChild_);
auto progressContext = progressChild_->GetRenderContext();
CHECK_NULL_VOID(progressContext);
progressContext->UpdateOpacity(0.0f);
@ -334,6 +335,7 @@ void RefreshPattern::InitChildNode()
UpdateLoadingProgress();
}
}
CHECK_NULL_VOID(progressChild_);
auto progressAccessibilityProperty = progressChild_->GetAccessibilityProperty<AccessibilityProperty>();
CHECK_NULL_VOID(progressAccessibilityProperty);
progressAccessibilityProperty->SetAccessibilityLevel(accessibilityLevel);
@ -660,10 +662,7 @@ void RefreshPattern::UpdateRefreshStatus(RefreshStatus newStatus)
FireChangeEvent("false");
}
FireStateChange(static_cast<int>(refreshStatus_));
TAG_LOGI(AceLogTag::ACE_REFRESH,
"Refresh status changed %{public}d, loadingProgress opacity is %{public}f and loading text opacity is "
"%{public}f",
static_cast<int32_t>(refreshStatus_), GetLoadingProgressOpacity(), GetLoadingTextOpacity());
TAG_LOGI(AceLogTag::ACE_REFRESH, "Refresh status changed %{public}d", static_cast<int32_t>(refreshStatus_));
}
void RefreshPattern::SwitchToFinish()
@ -1059,6 +1058,7 @@ void RefreshPattern::LoadingProgressExit()
void RefreshPattern::UpdateLoadingProgress()
{
CHECK_NULL_VOID(progressChild_);
float loadingProgressOffset =
std::clamp(scrollOffset_, triggerLoadingDistance_, static_cast<float>(MAX_SCROLL_DISTANCE.ConvertToPx()));
UpdateLoadingMarginTop(loadingProgressOffset);