1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 03:05:31 +00:00

One shot page loaded

This commit is contained in:
M66B 2021-02-17 09:45:26 +01:00
parent 7c34414e7c
commit bd3f66913b
2 changed files with 24 additions and 5 deletions

View file

@ -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) {

View file

@ -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) {