mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2025-01-08 09:53:20 +00:00
springAnimation bugfix: finishCallback is not executed after stop springAnimation.
Signed-off-by: liyi55 <liyi55@huawei.com>
This commit is contained in:
parent
489e597d25
commit
8f9d259ba3
@ -3488,15 +3488,15 @@ void SwiperPattern::PlaySpringAnimation(double dragVelocity)
|
|||||||
CHECK_NULL_VOID(swiperPattern);
|
CHECK_NULL_VOID(swiperPattern);
|
||||||
ACE_SCOPED_TRACE_COMMERCIAL("%s start spring animation",
|
ACE_SCOPED_TRACE_COMMERCIAL("%s start spring animation",
|
||||||
swiperPattern->hasTabsAncestor_ ? V2::TABS_ETS_TAG : V2::SWIPER_ETS_TAG);
|
swiperPattern->hasTabsAncestor_ ? V2::TABS_ETS_TAG : V2::SWIPER_ETS_TAG);
|
||||||
swiperPattern->OnSpringAnimationStart(static_cast<float>(dragVelocity));
|
|
||||||
host->UpdateAnimatablePropertyFloat(SPRING_PROPERTY_NAME, delta);
|
host->UpdateAnimatablePropertyFloat(SPRING_PROPERTY_NAME, delta);
|
||||||
swiperPattern->springAnimationIsRunning_ = true;
|
|
||||||
},
|
},
|
||||||
[weak = AceType::WeakClaim(this)]() {
|
[weak = AceType::WeakClaim(this)]() {
|
||||||
auto swiperPattern = weak.Upgrade();
|
auto swiperPattern = weak.Upgrade();
|
||||||
CHECK_NULL_VOID(swiperPattern);
|
CHECK_NULL_VOID(swiperPattern);
|
||||||
swiperPattern->OnSpringAnimationFinish();
|
swiperPattern->OnSpringAnimationFinish();
|
||||||
});
|
});
|
||||||
|
OnSpringAnimationStart(static_cast<float>(dragVelocity));
|
||||||
|
springAnimationIsRunning_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SwiperPattern::IsOutOfBoundary(float mainOffset) const
|
bool SwiperPattern::IsOutOfBoundary(float mainOffset) const
|
||||||
|
Loading…
Reference in New Issue
Block a user