You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -76,12 +78,15 @@ class DuckDuckGoWebView : WebView, NestedScrollingChild {
76
78
event.offsetLocation(0f, nestedOffsetY.toFloat())
77
79
78
80
when (action) {
81
+
MotionEvent.ACTION_UP-> {
82
+
hasGestureFinished =true
83
+
returnValue =super.onTouchEvent(event)
84
+
stopNestedScroll()
85
+
}
79
86
MotionEvent.ACTION_MOVE-> {
80
87
var deltaY = lastY - eventY
81
88
82
-
if (deltaY >0) {
83
-
lastClampedTopY =false
84
-
}
89
+
lastClampedTopY = deltaY <=0
85
90
86
91
if (dispatchNestedPreScroll(0, deltaY, scrollConsumed, scrollOffset)) {
87
92
deltaY -= scrollConsumed[1]
@@ -98,15 +103,16 @@ class DuckDuckGoWebView : WebView, NestedScrollingChild {
98
103
lastY -= scrollOffset[1]
99
104
}
100
105
101
-
if (scrollY ==0&& lastClampedTopY && nestedOffsetY ==0) {
102
-
// we have reached the top, are clamped vertically and nestedScrollY is done too -> enable swipeRefresh (by default always disabled)
106
+
if (canSwipeToRefresh &&scrollY ==0&& lastClampedTopY && nestedOffsetY ==0) {
107
+
// we are on a new gesture, have reached the top, are clamped vertically and nestedScrollY is done too -> enable swipeRefresh (by default always disabled)
103
108
enableSwipeRefresh(true)
104
109
}
105
110
106
111
lastDeltaY = deltaY
107
112
}
108
113
109
114
MotionEvent.ACTION_DOWN-> {
115
+
hasGestureFinished =false
110
116
// disable swipeRefresh until we can be sure it should be enabled
111
117
enableSwipeRefresh(false)
112
118
@@ -153,7 +159,16 @@ class DuckDuckGoWebView : WebView, NestedScrollingChild {
0 commit comments