List of usage examples for android.webkit WebView requestLayout
@CallSuper public void requestLayout()
From source file:im.vector.adapters.ImagesSliderAdapter.java
private void loadImage(WebView webView, Uri imageUri, String viewportContent, String css) { String html = "<html><head><meta name='viewport' content='" + viewportContent + "'/>" + "<style type='text/css'>" + css + "</style></head>" + "<body> <div class='wrap'>" + "<img " + ("src='" + imageUri.toString() + "'") + " onerror='this.style.display=\"none\"' id='image' " + viewportContent + "/>" + "</div>" + "</body>" + "</html>"; String mime = "text/html"; String encoding = "utf-8"; webView.loadDataWithBaseURL(null, html, mime, encoding, null); webView.requestLayout(); }
From source file:im.neon.adapters.VectorMediasViewerAdapter.java
/** * Update the image page.//from w ww. java 2s . c om * @param webView the image is rendered in a webview. * @param imageUri the image Uri. * @param viewportContent the viewport. * @param css the css. */ private void loadImage(WebView webView, Uri imageUri, String viewportContent, String css) { String html = "<html><head><meta name='viewport' content='" + viewportContent + "'/>" + "<style type='text/css'>" + css + "</style></head>" + "<body> <div class='wrap'>" + "<img " + ("src='" + imageUri.toString() + "'") + " onerror='this.style.display=\"none\"' id='image' " + viewportContent + "/>" + "</div>" + "</body>" + "</html>"; String mime = "text/html"; String encoding = "utf-8"; webView.loadDataWithBaseURL(null, html, mime, encoding, null); webView.requestLayout(); }