Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix controller swipe #40

Closed
wants to merge 2 commits into from
Closed

Fix controller swipe #40

wants to merge 2 commits into from

Conversation

f3d0ss
Copy link

@f3d0ss f3d0ss commented Nov 25, 2021

When you call controller.forward(direction: SwipeDirection.Right) (or Left) while the animation of an older call is still ongoing the controller store a SwipeInfo with SwipeDirection.Right.

state!.swipeInfoList.add(SwipeInfo(state!.frontCardIndex, direction));

When the controller then call state!.runChangeOrderAnimation() the state find an older animation is still ongoing and the it return without doing nothing.
This way at the next controller.forward(direction: SwipeDirection.Left) (or Right) the card will swipe in the wrong direction.

A easy fix is to remove the last SwipeInfo if the animation is still ongoing.

@f3d0ss
Copy link
Author

f3d0ss commented Jan 3, 2022

Is there a reason why my PR is ignored?
I ask because I'm not an expert and I would like to know if it's because I have done something wrong.

@f3d0ss f3d0ss closed this Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant