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) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
boolean has = false;
clearActions();
if (cactions != null) {
List<ConversationAction> actions = cactions.getConversationActions();
for (final ConversationAction action : actions) {

@ -111,16 +111,20 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
@Override
public void onPageCommitVisible(WebView view, String url) {
Log.i("Commit url=" + url);
if (onPageLoaded != null)
Log.i("Commit url=" + url + " runnable=" + (onPageLoaded != null));
if (onPageLoaded != null) {
ApplicationEx.getMainHandler().post(onPageLoaded);
onPageLoaded = null;
}
}
@Override
public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) {
Log.i("Render process gone");
if (onPageLoaded != null)
Log.e("Render process gone");
if (onPageLoaded != null) {
ApplicationEx.getMainHandler().post(onPageLoaded);
onPageLoaded = null;
}
return super.onRenderProcessGone(view, detail);
}
@ -147,7 +151,23 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
}
void setOnPageLoaded(Runnable runnable) {
Log.i("Set on page finished");
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) {

Loading…
Cancel
Save