Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
// - Meta Wearables DAT SDK (mwdat-*) targets API 34+
minSdk 34
targetSdk 34
versionCode 20
versionName "1.6.0"
versionCode 21
versionName "1.6.1"
}

// VERSION_NAME is exposed via BuildConfig so the WebView UA + appVersion()
Expand Down
15 changes: 13 additions & 2 deletions android/app/src/main/java/press/maestro/crow/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,19 @@ protected void onCreate(Bundle savedInstanceState) {
return false;
}
lastScrollProbeMs = now;
// First the scroll containers under the finger, wherever they are on the page (the
// side menu is outside .content-body: a downward swipe in a scrolled menu used to
// pull to refresh instead of scrolling it back up). Touch coordinates are device
// pixels; elementFromPoint takes CSS pixels.
webView.evaluateJavascript(
"(function() {" +
"(function(x, y) {" +
" var d = window.devicePixelRatio || 1;" +
" for (var el = document.elementFromPoint(x / d, y / d); el && el !== document.documentElement; el = el.parentElement) {" +
" if (el.scrollHeight > el.clientHeight && el.scrollTop > 5) {" +
" var oy = window.getComputedStyle(el).overflowY;" +
" if (oy === 'auto' || oy === 'scroll') return el.scrollTop;" +
" }" +
" }" +
" var all = document.querySelectorAll('.content-body, .content-body *');" +
" for (var i = 0; i < all.length; i++) {" +
" var el = all[i];" +
Expand All @@ -230,7 +241,7 @@ protected void onCreate(Bundle savedInstanceState) {
" }" +
" }" +
" return window.scrollY || document.documentElement.scrollTop || 0;" +
"})()",
"})(" + event.getX() + ", " + event.getY() + ")",
value -> {
try {
double scrollTop = Double.parseDouble(value);
Expand Down
Loading