|
@@ -4,6 +4,7 @@ import android.support.annotation.NonNull;
|
4
|
4
|
import android.support.annotation.Nullable;
|
5
|
5
|
import android.view.GestureDetector;
|
6
|
6
|
import android.view.MotionEvent;
|
|
7
|
+import android.view.ViewConfiguration;
|
7
|
8
|
import android.widget.ScrollView;
|
8
|
9
|
|
9
|
10
|
import com.reactnativenavigation.NavigationApplication;
|
|
@@ -31,10 +32,12 @@ public class CollapseCalculator {
|
31
|
32
|
private OnFlingListener flingListener;
|
32
|
33
|
private int scrollY = 0;
|
33
|
34
|
private int totalCollapse = 0;
|
|
35
|
+ private final int scaledTouchSlop;
|
34
|
36
|
|
35
|
37
|
public CollapseCalculator(final CollapsingView collapsingView, CollapseBehaviour collapseBehaviour) {
|
36
|
38
|
this.view = collapsingView;
|
37
|
39
|
this.collapseBehaviour = collapseBehaviour;
|
|
40
|
+ scaledTouchSlop = ViewConfiguration.get(NavigationApplication.instance).getScaledTouchSlop();
|
38
|
41
|
setFlingDetector();
|
39
|
42
|
}
|
40
|
43
|
|
|
@@ -188,7 +191,7 @@ public class CollapseCalculator {
|
188
|
191
|
totalCollapse += collapse;
|
189
|
192
|
previousCollapseY = y;
|
190
|
193
|
previousTouchEvent = MotionEvent.obtain(event);
|
191
|
|
- return new CollapseAmount(collapse);
|
|
194
|
+ return Math.abs(totalCollapse) < scaledTouchSlop ? CollapseAmount.None : new CollapseAmount(collapse);
|
192
|
195
|
}
|
193
|
196
|
|
194
|
197
|
private float calculateCollapse(float y) {
|