mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 15:10:30 +00:00
!38684 Swiper: hide fadeanimation when direction change during dragging
Merge pull request !38684 from Hu_zq/master
This commit is contained in:
commit
48b6afaa44
@ -1967,6 +1967,10 @@ void SwiperPattern::InitPanEvent(const RefPtr<GestureEventHub>& gestureHub)
|
||||
if (direction_ == GetDirection() && panEvent_) {
|
||||
return;
|
||||
}
|
||||
// fade offset need to be reset when is still dragging
|
||||
if (direction_ != GetDirection()) {
|
||||
fadeOffset_ = 0.f;
|
||||
}
|
||||
direction_ = GetDirection();
|
||||
|
||||
auto actionStartTask = [weak = WeakClaim(this)](const GestureEvent& info) {
|
||||
|
@ -413,10 +413,14 @@ HWTEST_F(SwiperControllerTestNg, ShowNextShowPreviousChangeIndex008, TestSize.Le
|
||||
* @tc.expected: Show ChangeIndex page
|
||||
*/
|
||||
EXPECT_TRUE(VerifyChangeIndex(0, false, 0));
|
||||
// expect 0
|
||||
EXPECT_TRUE(VerifyChangeIndex(2, false, 2));
|
||||
EXPECT_TRUE(VerifyChangeIndex(3, false, 3));
|
||||
// expect 0
|
||||
EXPECT_TRUE(VerifyChangeIndex(3, false, 0));
|
||||
EXPECT_TRUE(VerifyChangeIndex(0, true, 0));
|
||||
// expect 0
|
||||
EXPECT_TRUE(VerifyChangeIndex(2, true, 1));
|
||||
// expect 0
|
||||
EXPECT_TRUE(VerifyChangeIndex(3, true, 1));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user