One shot page loaded

pull/194/head
M66B 4 years ago
parent 7c34414e7c
commit bd3f66913b

@ -2451,7 +2451,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void bindConversationActions(TupleMessageEx message, ConversationActions cactions) { private void bindConversationActions(TupleMessageEx message, ConversationActions cactions) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
boolean has = false; boolean has = false;
clearActions();
if (cactions != null) { if (cactions != null) {
List<ConversationAction> actions = cactions.getConversationActions(); List<ConversationAction> actions = cactions.getConversationActions();
for (final ConversationAction action : actions) { for (final ConversationAction action : actions) {

@ -111,16 +111,20 @@ 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 + " runnable=" + (onPageLoaded != null));
if (onPageLoaded != null) if (onPageLoaded != null) {
ApplicationEx.getMainHandler().post(onPageLoaded); ApplicationEx.getMainHandler().post(onPageLoaded);
onPageLoaded = null;
}
} }
@Override @Override
public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) { public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) {
Log.i("Render process gone"); Log.e("Render process gone");
if (onPageLoaded != null) if (onPageLoaded != null) {
ApplicationEx.getMainHandler().post(onPageLoaded); ApplicationEx.getMainHandler().post(onPageLoaded);
onPageLoaded = null;
}
return super.onRenderProcessGone(view, detail); return super.onRenderProcessGone(view, detail);
} }
@ -147,7 +151,23 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
} }
void setOnPageLoaded(Runnable runnable) { void setOnPageLoaded(Runnable runnable) {
Log.i("Set on page finished");
onPageLoaded = runnable; onPageLoaded = runnable;
ApplicationEx.getMainHandler().postDelayed(new Runnable() {
@Override
public void run() {
try {
if (onPageLoaded != null) {
Log.e("Page loaded fallback");
onPageLoaded.run();
onPageLoaded = null;
}
} catch (Throwable ex) {
Log.e(ex);
}
}
}, 2500L);
} }
void setImages(boolean show_images, boolean inline) { void setImages(boolean show_images, boolean inline) {

Loading…
Cancel
Save