Skip to content

Commit 3e839ed

Browse files
Pull to refresh sensitivity fix (#1190)
1 parent 3a10582 commit 3e839ed

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1674,7 +1674,6 @@ class BrowserTabFragment :
16741674

16751675
if (!viewState.isLoading && lastSeenBrowserViewState?.browserShowing == true) {
16761676
swipeRefreshContainer.isRefreshing = false
1677-
webView?.detectOverscrollBehavior()
16781677
}
16791678
}
16801679
}

app/src/main/java/com/duckduckgo/app/browser/DuckDuckGoWebView.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ class DuckDuckGoWebView : WebView, NestedScrollingChild {
103103
lastY -= scrollOffset[1]
104104
}
105105

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)
108-
enableSwipeRefresh(true)
109-
}
110-
111106
lastDeltaY = deltaY
112107
}
113108

@@ -176,16 +171,6 @@ class DuckDuckGoWebView : WebView, NestedScrollingChild {
176171
enableSwipeRefreshCallback = callback
177172
}
178173

179-
/**
180-
* Allows us to determine whether to (de)activate Swipe to Refresh behavior for the current page content, e.g. if page implements a swipe behavior of its
181-
* own already (see twitter.com).
182-
*/
183-
fun detectOverscrollBehavior() {
184-
evaluateJavascript("(function() { return getComputedStyle(document.querySelector('body')).overscrollBehaviorY; })();") { behavior ->
185-
setContentAllowsSwipeToRefresh(behavior.replace("\"", "") == "auto")
186-
}
187-
}
188-
189174
private fun enableSwipeRefresh(enable: Boolean) {
190175
enableSwipeRefreshCallback?.invoke(enable && contentAllowsSwipeToRefresh)
191176
}

0 commit comments

Comments
 (0)