Skip to content

Commit

Permalink
#237 Disable scroll when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyakaido committed Apr 16, 2019
1 parent b5ebf64 commit 11cb8fb
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 11cb8fb

Please sign in to comment.