未验证 提交 d4794122 编写于 作者: K Kaushik Iska 提交者: GitHub

Change the virtual display size restriction to warning (#9110)

* Change the virtual display size restriction to warning

- Fixes: https://github.com/flutter/flutter/issues/33290

- This is so we don't block usecases where users show the platform
  view partially.

- https://github.com/flutter/flutter/issues/31990 should address this
  issue more broadly.

* Fix error message
上级 4c4c0f82
......@@ -422,11 +422,12 @@ public class PlatformViewsController implements MethodChannel.MethodCallHandler,
private void validateVirtualDisplayDimensions(int width, int height) {
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
if (height > metrics.heightPixels || width > metrics.widthPixels) {
String error = "Creating a virtual display of size: "
+ "[" + width + ", " + height + "]"
+ " is not supported. It is larger than the device screen size: "
String message = "Creating a virtual display of size: "
+ "[" + width + ", " + height + "] may result in problems"
+ "(https://github.com/flutter/flutter/issues/2897)."
+ "It is larger than the device screen size: "
+ "[" + metrics.widthPixels + ", " + metrics.heightPixels + "].";
throw new IllegalArgumentException(error);
Log.w(TAG, message);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册