未验证 提交 42bd86d6 编写于 作者: A amirh 提交者: GitHub

Make the virtual display's presentation window non focusable. (#5845)

When the FlutterView's window loses focus Flutter cannot bring up the
keyboard (so e.g tapping on text fields doesn't work).

This workaround makes sure that Flutter text fields are working but
unfortunately now the embedded Android view cannot bring up the keyboard
as it's window is not focused.

Submitting this until as a stop gap while we're trying to figure out if
it's possible to allow both windows to bring up the keyboard.
上级 a726e1d8
......@@ -11,6 +11,7 @@ import android.os.Build;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.widget.FrameLayout;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
......@@ -32,6 +33,10 @@ class SingleViewPresentation extends Presentation {
super(outerContext, display);
mViewFactory = viewFactory;
mViewId = viewId;
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
);
}
/**
......@@ -45,6 +50,10 @@ class SingleViewPresentation extends Presentation {
super(outerContext, display);
mViewFactory = null;
mView = view;
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
);
}
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册