Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,11 @@ public boolean canChildScrollDown() {
}

private boolean canChildScrollRight() {
return ViewCompat.canScrollHorizontally(scrollChild, -1);
return ViewCompat.canScrollHorizontally(scrollChild, 1);
}

private boolean canChildScrollLeft() {
return ViewCompat.canScrollHorizontally(scrollChild, 1);
return ViewCompat.canScrollHorizontally(scrollChild, -1);
}

private void finish() {
Expand Down Expand Up @@ -327,11 +327,11 @@ public int clampViewPositionHorizontal(View child, int left, int dx) {

int result = 0;

if (dragEdge == DragEdge.LEFT && !canChildScrollRight() && left > 0) {
if (dragEdge == DragEdge.LEFT && !canChildScrollLeft() && left > 0) {
final int leftBound = getPaddingLeft();
final int rightBound = horizontalDragRange;
result = Math.min(Math.max(left, leftBound), rightBound);
} else if (dragEdge == DragEdge.RIGHT && !canChildScrollLeft() && left < 0) {
} else if (dragEdge == DragEdge.RIGHT && !canChildScrollRight() && left < 0) {
final int leftBound = -horizontalDragRange;
final int rightBound = getPaddingLeft();
result = Math.min(Math.max(left, leftBound), rightBound);
Expand Down