From 384b808c6d67af8dfc271581d62d2a8d22f15519 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 15 Jun 2024 11:50:26 +0200 Subject: [PATCH] Can scroll --- app/src/main/java/eu/faircode/email/WebViewEx.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/WebViewEx.java b/app/src/main/java/eu/faircode/email/WebViewEx.java index 922097f34d..7aef4e7f3c 100644 --- a/app/src/main/java/eu/faircode/email/WebViewEx.java +++ b/app/src/main/java/eu/faircode/email/WebViewEx.java @@ -205,8 +205,14 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC setOnScrollChangeListener(new View.OnScrollChangeListener() { @Override public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { - Log.i("Scroll (x,y)=" + scrollX + "," + scrollY); - intf.onScrollChange(scrollX - oldScrollX, scrollY - oldScrollY, scrollX, scrollY); + int yrange = computeVerticalScrollRange(); + int yextend = computeVerticalScrollExtent(); + int yoff = computeVerticalScrollOffset(); + boolean canScrollVertical = (yrange > yextend && yoff < yrange - yextend); + Log.i("Scroll (x,y)=" + scrollX + "," + scrollY + + " yrange=" + yrange + " yextend=" + yextend + " yoff=" + yoff + + " can=" + canScrollVertical); + intf.onScrollChange(scrollX - oldScrollX, canScrollVertical ? scrollY - oldScrollY : -1, scrollX, scrollY); } }); }