Skip to content

Commit 77a2ddc

Browse files
author
alexey.chernenko
committed
fixed scroll issue
1 parent 4fb9261 commit 77a2ddc

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.1.0'
8+
classpath 'com.android.tools.build:gradle:2.2.0'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files

library/src/main/java/com/yalantis/pulltomakesoup/PullToRefreshView.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ private void ensureTarget() {
161161

162162
@Override
163163
public boolean onInterceptTouchEvent(MotionEvent ev) {
164-
165164
if (!isEnabled() || canChildScrollUp() || mRefreshing) {
166165
return false;
167166
}
@@ -180,7 +179,14 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
180179
mInitialMotionY = initialMotionY;
181180
break;
182181
case MotionEvent.ACTION_MOVE:
183-
final float yDiff = getMotionEventY(ev, mActivePointerId);
182+
if (mActivePointerId == INVALID_POINTER) {
183+
return false;
184+
}
185+
final float y = getMotionEventY(ev, mActivePointerId);
186+
if (y == -1) {
187+
return false;
188+
}
189+
final float yDiff = y - mInitialMotionY;
184190
if (yDiff > mTouchSlop && !mIsBeingDragged) {
185191
mIsBeingDragged = true;
186192
}

0 commit comments

Comments
 (0)