Skip to content

Commit 78d7fe8

Browse files
committed
Ramotion#9 Fix not smooth scrolling, with big cardsGap
Based on Ramotion#10 bug fix
1 parent 86c2fc0 commit 78d7fe8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: card-slider/src/main/java/com/ramotion/cardslider/DefaultViewUpdater.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ public void updateView(@NonNull View view, float position) {
7979
scale = SCALE_CENTER - SCALE_CENTER_TO_RIGHT * ratio;
8080
alpha = 1;
8181
z = Z_CENTER_2;
82-
x = -Math.min(transitionRight2Center, transitionRight2Center * (viewLeft - transitionEnd) / transitionDistance);
82+
if (Math.abs(transitionRight2Center) < Math.abs(transitionRight2Center * (viewLeft - transitionEnd) / transitionDistance)) {
83+
x = -transitionRight2Center;
84+
} else {
85+
x = -transitionRight2Center * (viewLeft - transitionEnd) / transitionDistance;
86+
}
8387
} else {
8488
scale = SCALE_RIGHT;
8589
alpha = 1;

0 commit comments

Comments
 (0)