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
String h = (data == null ? null : Helper.md5(data.getBytes())); boolean i = getSettings().getLoadsImagesAutomatically();
if (Objects.equals(hash, h)) if (Objects.equals(this.images, i)) {
return; String h = (data == null ? null : Helper.md5(data.getBytes()));
this.hash = h; if (Objects.equals(this.hash, h))
return;
this.hash = h;
} else
this.images = i;
} catch (Throwable ex) { } catch (Throwable ex) {
Log.w(ex); Log.w(ex);
} }

Loading…
Cancel
Save