Refactoring

This commit is contained in:
M66B 2021-02-17 09:15:31 +01:00
parent 6103c8576a
commit 7c34414e7c
2 changed files with 8 additions and 8 deletions

View File

@ -2371,7 +2371,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvSignedData.setVisibility(signed_data ? View.VISIBLE : View.GONE); tvSignedData.setVisibility(signed_data ? View.VISIBLE : View.GONE);
if (show_full) { if (show_full) {
((WebViewEx) wvBody).setOnPageFinished(new Runnable() { ((WebViewEx) wvBody).setOnPageLoaded(new Runnable() {
@Override @Override
public void run() { public void run() {
try { try {

View File

@ -44,7 +44,7 @@ import static androidx.webkit.WebSettingsCompat.FORCE_DARK_ON;
public class WebViewEx extends WebView implements DownloadListener, View.OnLongClickListener { public class WebViewEx extends WebView implements DownloadListener, View.OnLongClickListener {
private int height; private int height;
private IWebView intf; private IWebView intf;
private Runnable onPageFinished; private Runnable onPageLoaded;
public WebViewEx(Context context) { public WebViewEx(Context context) {
super(context); super(context);
@ -112,15 +112,15 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
@Override @Override
public void onPageCommitVisible(WebView view, String url) { public void onPageCommitVisible(WebView view, String url) {
Log.i("Commit url=" + url); Log.i("Commit url=" + url);
if (onPageFinished != null) if (onPageLoaded != null)
ApplicationEx.getMainHandler().post(onPageFinished); ApplicationEx.getMainHandler().post(onPageLoaded);
} }
@Override @Override
public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) { public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) {
Log.i("Render process gone"); Log.i("Render process gone");
if (onPageFinished != null) if (onPageLoaded != null)
ApplicationEx.getMainHandler().post(onPageFinished); ApplicationEx.getMainHandler().post(onPageLoaded);
return super.onRenderProcessGone(view, detail); return super.onRenderProcessGone(view, detail);
} }
@ -146,8 +146,8 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
}); });
} }
void setOnPageFinished(Runnable runnable) { void setOnPageLoaded(Runnable runnable) {
onPageFinished = runnable; onPageLoaded = runnable;
} }
void setImages(boolean show_images, boolean inline) { void setImages(boolean show_images, boolean inline) {