From 75951b3a661f420ee0aca0363186231e868e6bf4 Mon Sep 17 00:00:00 2001 From: Levi Moreira Date: Wed, 16 Nov 2022 15:37:11 +0000 Subject: [PATCH] Update scrolling offset to scroll at list half a page, otherwise we'll snap back when hitting the bounds. --- .../accompanist/pager/HorizontalPagerScrollingContentTest.kt | 2 +- .../accompanist/pager/VerticalPagerScrollingContentTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pager/src/sharedTest/kotlin/com/google/accompanist/pager/HorizontalPagerScrollingContentTest.kt b/pager/src/sharedTest/kotlin/com/google/accompanist/pager/HorizontalPagerScrollingContentTest.kt index 97779915c..6e7fbcf0f 100644 --- a/pager/src/sharedTest/kotlin/com/google/accompanist/pager/HorizontalPagerScrollingContentTest.kt +++ b/pager/src/sharedTest/kotlin/com/google/accompanist/pager/HorizontalPagerScrollingContentTest.kt @@ -92,7 +92,7 @@ class HorizontalPagerScrollingContentTest { // Perform a scroll in the same direction again rule.onNodeWithTag(TestTag) - .swipeAcrossCenterWithVelocity(velocityPerSec = 2_000.dp, distancePercentageX = -0.5f) + .swipeAcrossCenterWithVelocity(velocityPerSec = 2_000.dp, distancePercentageX = -0.6f) // Wait for the flings to end rule.waitForIdle() diff --git a/pager/src/sharedTest/kotlin/com/google/accompanist/pager/VerticalPagerScrollingContentTest.kt b/pager/src/sharedTest/kotlin/com/google/accompanist/pager/VerticalPagerScrollingContentTest.kt index 0328f3cf3..78333781f 100644 --- a/pager/src/sharedTest/kotlin/com/google/accompanist/pager/VerticalPagerScrollingContentTest.kt +++ b/pager/src/sharedTest/kotlin/com/google/accompanist/pager/VerticalPagerScrollingContentTest.kt @@ -91,7 +91,7 @@ class VerticalPagerScrollingContentTest { // Perform a scroll in the same direction again rule.onNodeWithTag(TestTag) - .swipeAcrossCenterWithVelocity(velocityPerSec = 2_000.dp, distancePercentageY = -0.5f) + .swipeAcrossCenterWithVelocity(velocityPerSec = 2_000.dp, distancePercentageY = -0.6f) // Wait for the flings to end rule.waitForIdle()