From 7e2e143e62c70124b82b8cc0a9f4fad1d7886c1b Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 22 Feb 2021 12:59:13 +0100 Subject: [PATCH] Refactoring --- app/src/main/java/eu/faircode/email/WebViewEx.java | 6 ++++-- 1 file changed, 4 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 73d1a0a76a..2cb7e05c0f 100644 --- a/app/src/main/java/eu/faircode/email/WebViewEx.java +++ b/app/src/main/java/eu/faircode/email/WebViewEx.java @@ -46,6 +46,8 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC private IWebView intf; private Runnable onPageLoaded; + private static final long PAGE_LOADED_FALLBACK_DELAY = 1500L; // milliseconds + public WebViewEx(Context context) { super(context); @@ -159,7 +161,7 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC public void run() { try { if (onPageLoaded != null) { - Log.w("Page loaded fallback"); + Log.i("Page loaded fallback"); onPageLoaded.run(); onPageLoaded = null; } @@ -167,7 +169,7 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC Log.e(ex); } } - }, 1500L); + }, PAGE_LOADED_FALLBACK_DELAY); } void setImages(boolean show_images, boolean inline) {