Commit ef8d0d1f authored by Lorenzo Pichilli's avatar Lorenzo Pichilli

fix #190 keyboard not showing on the second or more created webviews

parent ec47b191
This diff is collapsed.
......@@ -36,14 +36,12 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
public final MethodChannel channel;
public final Registrar registrar;
public FlutterWebView(Registrar registrar, int id, HashMap<String, Object> params, View containerView) {
public FlutterWebView(Registrar registrar, final Context context, int id, HashMap<String, Object> params, View containerView) {
this.registrar = registrar;
this.activity = registrar.activity();
DisplayListenerProxy displayListenerProxy = new DisplayListenerProxy();
DisplayManager displayManager =
(DisplayManager) this.registrar.context().getSystemService(Context.DISPLAY_SERVICE);
DisplayManager displayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
displayListenerProxy.onPreWebViewInitialization(displayManager);
String initialUrl = (String) params.get("initialUrl");
......@@ -55,7 +53,7 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
InAppWebViewOptions options = new InAppWebViewOptions();
options.parse(initialOptions);
webView = new InAppWebView(registrar, this, id, options, containerView);
webView = new InAppWebView(registrar, context, this, id, options, containerView);
displayListenerProxy.onPostWebViewInitialization(displayManager);
webView.prepare();
......
......@@ -23,7 +23,7 @@ public class FlutterWebViewFactory extends PlatformViewFactory {
@Override
public PlatformView create(Context context, int id, Object args) {
HashMap<String, Object> params = (HashMap<String, Object>) args;
return new FlutterWebView(registrar, id, params, containerView);
return new FlutterWebView(registrar, context, id, params, containerView);
}
}
......@@ -508,8 +508,8 @@ final public class InAppWebView extends InputAwareWebView {
super(context, attrs, defaultStyle);
}
public InAppWebView(PluginRegistry.Registrar registrar, Object obj, int id, InAppWebViewOptions options, View containerView) {
super(registrar.activeContext(), containerView);
public InAppWebView(PluginRegistry.Registrar registrar, Context context, Object obj, int id, InAppWebViewOptions options, View containerView) {
super(context, containerView);
this.registrar = registrar;
if (obj instanceof InAppBrowserActivity)
this.inAppBrowserActivity = (InAppBrowserActivity) obj;
......
This diff is collapsed.
......@@ -1284,7 +1284,7 @@ class InAppWebViewController {
///This should not be called if Safe Browsing has been disabled by manifest tag
///or [AndroidInAppWebViewOptions.safeBrowsingEnabled]. This prepares resources used for Safe Browsing.
///
///**NOTE**: available only for Android.
///**NOTE**: available on Android 27+.
Future<bool> startSafeBrowsing() async {
Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) {
......@@ -1308,7 +1308,7 @@ class InAppWebViewController {
///
///[hosts] represents the list of hosts. This value must never be null.
///
///**NOTE**: available only for Android.
///**NOTE**: available on Android 27+.
Future<bool> setSafeBrowsingWhitelist({@required List<String> hosts}) async {
assert(hosts != null);
Map<String, dynamic> args = <String, dynamic>{};
......@@ -1322,7 +1322,7 @@ class InAppWebViewController {
///Returns a URL pointing to the privacy policy for Safe Browsing reporting. This value will never be `null`.
///
///**NOTE**: available only for Android.
///**NOTE**: available on Android 27+.
Future<String> getSafeBrowsingPrivacyPolicyUrl() async {
Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) {
......@@ -1344,7 +1344,7 @@ class InAppWebViewController {
///Clears the SSL preferences table stored in response to proceeding with SSL certificate errors.
///
///**NOTE**: available only for Android.
///**NOTE**: available only on Android.
Future<void> clearSslPreferences() async {
Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) {
......@@ -1360,7 +1360,7 @@ class InAppWebViewController {
///
///**NOTE**: On iOS certificate-based credentials are never stored permanently.
///
///**NOTE**: available only for Android.
///**NOTE**: available on Android 21+.
Future<void> clearClientCertPreferences() async {
Map<String, dynamic> args = <String, dynamic>{};
if (_inAppBrowserUuid != null && _inAppBrowser != null) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment