Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 984f47d

Browse files
committed
yuyakaido#228 Fix a bug that onCardSwiped always returns button as direction
1 parent 27e89ec commit 984f47d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cardstackview/src/main/java/com/yuyakaido/android/cardstackview/CardStackLayoutManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ private void update(RecyclerView.Recycler recycler) {
257257
// 6. ページング完了後はBが表示されるはずが、Aが画面に表示される
258258
removeAndRecycleView(getTopView(), recycler);
259259

260+
final Direction direction = state.getDirection();
261+
260262
state.next(state.status.toAnimatedStatus());
261263
state.topPosition++;
262264
state.dx = 0;
@@ -296,7 +298,6 @@ private void update(RecyclerView.Recycler recycler) {
296298
* at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
297299
* at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
298300
*/
299-
final Direction direction = state.getDirection();
300301
new Handler().post(new Runnable() {
301302
@Override
302303
public void run() {

0 commit comments

Comments
 (0)