mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Change the virtual display size restriction to warning (flutter/engine#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
This commit is contained in:
parent
99e54871e8
commit
780b9e0918
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user