Fixed original message view not/showing images

pull/217/head
M66B 8 months ago
parent 45489f9082
commit 8eedaa0286

@ -58,7 +58,6 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
private IWebView intf;
private Runnable onPageLoaded;
private String hash;
private Boolean images;
private static String userAgent = null;
@ -247,6 +246,10 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
void setImages(boolean show_images, boolean inline) {
WebSettings settings = getSettings();
if (settings.getLoadsImagesAutomatically() != show_images)
this.hash = null;
settings.setLoadsImagesAutomatically(show_images || inline);
settings.setBlockNetworkLoads(!show_images);
settings.setBlockNetworkImage(!show_images);
@ -256,14 +259,10 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
public void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl) {
try {
// Prevent flickering
boolean i = getSettings().getLoadsImagesAutomatically();
if (Objects.equals(this.images, i)) {
String h = (data == null ? null : Helper.md5(data.getBytes()));
if (Objects.equals(this.hash, h))
return;
this.hash = h;
} else
this.images = i;
String h = (data == null ? null : Helper.md5(data.getBytes()));
if (Objects.equals(this.hash, h))
return;
this.hash = h;
} catch (Throwable ex) {
Log.w(ex);
}

Loading…
Cancel
Save