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

Motion Layout onTransitionCompleted() listener error #225

Open
muhammad-hamza-shahid opened this issue Aug 30, 2021 · 1 comment
Open

Motion Layout onTransitionCompleted() listener error #225

muhammad-hamza-shahid opened this issue Aug 30, 2021 · 1 comment

Comments

@muhammad-hamza-shahid
Copy link

I am using swipe functionality to make a transition

onTransitionCompleted() listener of motion layout sometimes trigger twice I have set a check in current Id of transition to increment a value, but it sometimes trigger twice which increments the value 2 time.

@muhammad-hamza-shahid
Copy link
Author

So I have used this to handle the problem hope it works for you as well, Just checked if the event occurs before 250 milli sec, you can customize it according to your need.

if (SystemClock.elapsedRealtime() - mLastSwipe < 250){
                    return
                }
                mLastSwipe = SystemClock.elapsedRealtime()

I have used it in start of onTransitionCompleted() listener and it worked.

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

No branches or pull requests

1 participant