fix swiper in launcher don't show child

Signed-off-by: caocan <1532643766@qq.com>
Change-Id: I86a307d16b9a48776c8fb8665fc1687a9622cf90
This commit is contained in:
caocan
2022-04-13 12:20:17 +08:00
parent 20f3c101d0
commit 7d09c638f5
@@ -189,7 +189,9 @@ void RenderSwiper::Update(const RefPtr<Component>& component)
remoteMessageEvent_ = AceAsyncEvent<void(const std::shared_ptr<ClickInfo>&)>::Create(
swiper->GetRemoteMessageEventId(), context_);
RegisterChangeEndListener(COMPONENT_CHANGE_END_LISTENER_KEY, swiper->GetChangeEndListener());
if (swiper && swiper_ && (*swiper == *swiper_) && currentIndex_ == static_cast<int32_t>(swiper->GetIndex())) {
auto lazyComponent = swiper->GetLazyForEachComponent();
if (swiper && swiper_ && (*swiper == *swiper_) &&
currentIndex_ == static_cast<int32_t>(swiper->GetIndex()) && lazyComponent) {
LOGI("swiper not changed");
swiper_ = swiper;
return;
@@ -254,7 +256,6 @@ void RenderSwiper::Update(const RefPtr<Component>& component)
showIndicator_ = swiper->IsShowIndicator();
lazyLoadCacheSize_ = swiper->GetCachedSize() * 2 + swiper->GetDisplayCount();
auto lazyComponent = swiper->GetLazyForEachComponent();
UpdateItemCount(lazyComponent ? static_cast<int32_t>(lazyComponent->TotalCount()) : itemCount_);
ClearItems(lazyComponent, static_cast<int32_t>(swiper->GetIndex()));