xmuSistone / CardSlidePanel

enable users to slide card to the left or right smoothly and continuously
2.39k stars 516 forks source link

can i make the card just swipe horizontally (only on X-axis) #53

Closed joecizac closed 7 years ago

joecizac commented 7 years ago

First of all, thanks for the brilliant library. In my project I want the card to swipe-dismiss like a swipable recyclerView Item: i.e. the card should not swipe up or down and should be locked to move only horizontally along the X-axis.

Sorry if this is a duplicate question as I could not make out as almost all issues are raised in Chinese.

xmuSistone commented 7 years ago

swipe only on X-axis, you need to modify the CardSlidePanel.java file as follow:

@Override
public int clampViewPositionVertical(View child, int top, int dy) {
    return child.getTop();
}