springAnimation bugfix: finishCallback is not executed after stop springAnimation.

Signed-off-by: liyi55 <liyi55@huawei.com>
This commit is contained in:
liyi55 2024-07-30 20:23:13 +08:00
parent 489e597d25
commit 8f9d259ba3

View File

@ -3488,15 +3488,15 @@ void SwiperPattern::PlaySpringAnimation(double dragVelocity)
CHECK_NULL_VOID(swiperPattern);
ACE_SCOPED_TRACE_COMMERCIAL("%s start spring animation",
swiperPattern->hasTabsAncestor_ ? V2::TABS_ETS_TAG : V2::SWIPER_ETS_TAG);
swiperPattern->OnSpringAnimationStart(static_cast<float>(dragVelocity));
host->UpdateAnimatablePropertyFloat(SPRING_PROPERTY_NAME, delta);
swiperPattern->springAnimationIsRunning_ = true;
},
[weak = AceType::WeakClaim(this)]() {
auto swiperPattern = weak.Upgrade();
CHECK_NULL_VOID(swiperPattern);
swiperPattern->OnSpringAnimationFinish();
});
OnSpringAnimationStart(static_cast<float>(dragVelocity));
springAnimationIsRunning_ = true;
}
bool SwiperPattern::IsOutOfBoundary(float mainOffset) const