Skip to content

Commit

Permalink
Merge pull request #247 from yuyakaido/issue/237
Browse files Browse the repository at this point in the history
Disable scroll when empty to avoid invoking onCardDragging
  • Loading branch information
yuyakaido authored May 9, 2019
2 parents b5ebf64 + 11cb8fb commit b1b6053
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public boolean canScrollVertically() {

@Override
public int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler, RecyclerView.State s) {
if (state.topPosition == getItemCount()) {
return 0;
}

switch (state.status) {
case Idle:
if (setting.swipeableMethod.canSwipeManually()) {
Expand Down Expand Up @@ -106,11 +110,16 @@ public int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler, Recycler
case ManualSwipeAnimated:
break;
}

return 0;
}

@Override
public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State s) {
if (state.topPosition == getItemCount()) {
return 0;
}

switch (state.status) {
case Idle:
if (setting.swipeableMethod.canSwipeManually()) {
Expand Down

0 comments on commit b1b6053

Please sign in to comment.