yuyakaido / CardStackView

📱Tinder like swipeable card view for Android
Apache License 2.0
2.38k stars 452 forks source link

onCardSwiped always returns bottom? #228

Closed liuyaxin closed 5 years ago

liuyaxin commented 5 years ago

so how can i judge which direction the previous card swiped?

yuyakaido commented 5 years ago

@liuyaxin Swiped card always returns from bottom. Currently, we can't specify rewind direction.

liuyaxin commented 5 years ago

You don't know what i means. When I swiped a card to left, the onCardSwiped is called with a parameter direction "bottom". Maybe "left" should be returned? So as I swiped a card to right.

I have solved the problem, the code is like this:

removeAndRecycleView(getTopView(), recycler);
final Direction direction = state.getDirection();

state.next(state.status.toAnimatedStatus());
state.topPosition++;
state.dx = 0;
state.dy = 0;
if (state.topPosition == state.targetPosition) {
    state.targetPosition = RecyclerView.NO_POSITION;
}
tuandungnguyen commented 5 years ago

Yes. Always return Bottom. Why not Left and Right like previous version. So we can detect Left Swipe or Right Swipe. This version is very strange

valiiscoding commented 5 years ago

Please fix it! A very important feature! Thanks and keep up the great work, please!!! Thank you 👍

yuyakaido commented 5 years ago

@liuyaxin Sorry, I misunderstood what you said. This is a bug from ver. 2.3.0.

@liuyaxin @dungnguyendotme @valiiscoding I will fix this bug as soon as possible.

yuyakaido commented 5 years ago

@liuyaxin @dungnguyendotme @valiiscoding This issue has been fixed in ver. 2.3.2.

liuyaxin commented 5 years ago

okey~ very great work~!