mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
CB-481 refactored prompt() call in JS to exec, moved showing of webview out of chrome client and into app plugin (so we can invoke via exec)
This commit is contained in:
@@ -27,6 +27,8 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.webkit.WebView;
|
||||
import android.app.Activity;
|
||||
import android.view.View;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -51,6 +53,14 @@ public class App extends Plugin {
|
||||
if (action.equals("clearCache")) {
|
||||
this.clearCache();
|
||||
}
|
||||
else if (action.equals("show")) {
|
||||
final CordovaWebView wv = this.webView;
|
||||
((Activity)this.ctx).runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
wv.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (action.equals("loadUrl")) {
|
||||
this.loadUrl(args.getString(0), args.optJSONObject(1));
|
||||
}
|
||||
|
||||
@@ -227,14 +227,6 @@ public class CordovaChromeClient extends WebChromeClient {
|
||||
result.confirm(r);
|
||||
}
|
||||
|
||||
// Cordova JS has initialized, so show webview
|
||||
// (This solves white flash seen when rendering HTML)
|
||||
else if (reqOk && defaultValue != null && defaultValue.equals("gap_init:")) {
|
||||
appView.setVisibility(View.VISIBLE);
|
||||
//ctx.spinnerStop();
|
||||
result.confirm("OK");
|
||||
}
|
||||
|
||||
// Show dialog
|
||||
else {
|
||||
final JsPromptResult res = result;
|
||||
|
||||
Reference in New Issue
Block a user