Fixed switching images / WebView

pull/212/head
M66B 2 years ago
parent 315bcc74ca
commit 57829b7b04

@ -51,6 +51,7 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
private IWebView intf; private IWebView intf;
private Runnable onPageLoaded; private Runnable onPageLoaded;
private String hash; private String hash;
private Boolean images;
private static String userAgent = null; private static String userAgent = null;
@ -224,10 +225,14 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
public void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl) { public void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl) {
try { try {
// Prevent flickering // Prevent flickering
boolean i = getSettings().getLoadsImagesAutomatically();
if (Objects.equals(this.images, i)) {
String h = (data == null ? null : Helper.md5(data.getBytes())); String h = (data == null ? null : Helper.md5(data.getBytes()));
if (Objects.equals(hash, h)) if (Objects.equals(this.hash, h))
return; return;
this.hash = h; this.hash = h;
} else
this.images = i;
} catch (Throwable ex) { } catch (Throwable ex) {
Log.w(ex); Log.w(ex);
} }

Loading…
Cancel
Save