Panagiotis Triantafyllou

steps fixes

......@@ -128,6 +128,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
private Activity WarpActivity;
private String geolocationOrigin = "";
private Callback geolocationCallback;
private static boolean mWebviewLoaded = false;
// ===========================================================
// Constructors
......@@ -146,6 +147,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
super(context, null);
ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
WarpActivity = activity;
mWebviewLoaded = false;
init();
}
......@@ -416,6 +418,13 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
DefaultLifecycleObserver.super.onStart(owner);
if (!EventBus.getDefault().isRegistered(this))
EventBus.getDefault().register(this);
if (mWebviewLoaded) {
String scriptSourceInit = "webviewDidFocus(true);";
WarpView.this.evaluateJavascript(scriptSourceInit, s -> {
});
}
}
@Override
......@@ -771,6 +780,12 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
@Override
public void onPageFinished(WebView view, String url) {
mWebviewLoaded = true;
String scriptSourceInit = "webviewDidFocus(true);";
view.evaluateJavascript(scriptSourceInit, s -> {
});
String scriptSource = "passParams(" + WarpUtils.getWebviewParams(getContext()) + ");";
view.evaluateJavascript(scriptSource, s -> {
......