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

Disabling right or left swipe not respected when moving to it directly from the opposite position. #40

Open
gajicm93 opened this issue Nov 19, 2018 · 2 comments

Comments

@gajicm93
Copy link

When I disable just one side of the layout, for eg. right, while leaving left enabled, it works properly in terms of not being able to swipe right from neutral position, but if I first swipe to left (which is enabled), and then try to move it "directly" to right, with single swipe, it allows me to go right even though it's disabled.

@VitalySizov
Copy link

VitalySizov commented Jun 23, 2022

You can fix this problem adding to check:
isLeftSwipeEnabled and isRightSwipeEnabled

private int clampMoveRight(View child, int left) {
 if (leftView == null || !isLeftSwipeEnabled())  {
...
}
...
}

private int clampMoveLeft(View child, int left) {
if (rightView == null || !isRightSwipeEnabled()) {
...
}
}

@MADHUSUDHANRAO527
Copy link

MADHUSUDHANRAO527 commented Jan 29, 2024

It will work , just make visibility gone to which ever view is not needed!

Example: when right swipe - whats app msg need to be send, for left swipe SMS needs to send
in one case - only whatsapp needs to enabled, SMS needs to be disabled, this case make SMS view visibility GONE

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

3 participants