Skip to content

Commit

Permalink
fix #190 keyboard not showing on the second or more created webviews
Browse files Browse the repository at this point in the history
  • Loading branch information
pichillilorenzo committed Nov 25, 2019
1 parent ec47b19 commit ef8d0d1
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 1,203 deletions.
337 changes: 126 additions & 211 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -55,7 +53,7 @@ public FlutterWebView(Registrar registrar, int id, HashMap<String, Object> param
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public FlutterWebViewFactory(Registrar registrar, View containerView) {
@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);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ public InAppWebView(Context context, AttributeSet attrs, int defaultStyle) {
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;
Expand Down
575 changes: 69 additions & 506 deletions example/lib/in_app_webiew_example.screen.dart

Large diffs are not rendered by default.

Loading

0 comments on commit ef8d0d1

Please sign in to comment.