|
|
|
@ -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;
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
Log.w(ex);
|
|
|
|
|
}
|
|
|
|
|