-
Notifications
You must be signed in to change notification settings - Fork 6k
Add a Display
API to dart:ui that reports the physical size, DPR, and refresh rate of the main display
#41685
Conversation
Display
API to dart:ui that reports the physical size, DPR, and refresh rate of the main display
I'm going to try to add some tests for this tomorrow. |
You can prob test if |
How can I do that on the object itself though? Ther'es some weird ObjC way to spy on a method of a real class right? I can't remember. |
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
The engine roll is currently failing (https://cirrus-ci.com/task/5475027185827840?logs=main#L172) because of a doc issue introduced by #41685. This fixes the doc issue.
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
The engine roll is currently failing (https://cirrus-ci.com/task/5475027185827840?logs=main#L172) because of a doc issue introduced by #41685. This fixes the doc issue.
…ze, DPR, and refresh rate of the main display (flutter/engine#41685)
…126262) flutter/engine@23f730e...c42dd23 2023-05-08 goderbauer@google.com Fix doc to fix engine roll (flutter/engine#41812) 2023-05-08 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.3.2 to 2.3.3 (flutter/engine#41811) 2023-05-08 skia-flutter-autoroll@skia.org Roll Skia from 802eb7f66fc5 to 5f7e572995b1 (1 revision) (flutter/engine#41809) 2023-05-08 skia-flutter-autoroll@skia.org Roll Skia from f9bef8f7bdb5 to 802eb7f66fc5 (1 revision) (flutter/engine#41807) 2023-05-08 skia-flutter-autoroll@skia.org Roll Skia from 148ebc0596b7 to f9bef8f7bdb5 (1 revision) (flutter/engine#41806) 2023-05-08 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from VD0zJZ-ezOAfA9O1s... to KZrdNPIOcs5m2MqV_... (flutter/engine#41805) 2023-05-07 skia-flutter-autoroll@skia.org Roll Skia from 642ba306e140 to 148ebc0596b7 (1 revision) (flutter/engine#41804) 2023-05-07 skia-flutter-autoroll@skia.org Roll Skia from 8a93b289c2ed to 642ba306e140 (1 revision) (flutter/engine#41802) 2023-05-07 skia-flutter-autoroll@skia.org Roll ICU from d8daa943f64c to a2961dc659b4 (2 revisions) (flutter/engine#41801) 2023-05-07 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from k4NzlntuagXZIlCJg... to VD0zJZ-ezOAfA9O1s... (flutter/engine#41800) 2023-05-07 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from FFOWihz4lzOeDHmNj... to k4NzlntuagXZIlCJg... (flutter/engine#41799) 2023-05-06 skia-flutter-autoroll@skia.org Roll Dart SDK from d04e8b571819 to ab64c4a56e2c (1 revision) (flutter/engine#41798) 2023-05-06 dnfield@google.com Add a `Display` API to dart:ui that reports the physical size, DPR, and refresh rate of the main display (flutter/engine#41685) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from FFOWihz4lzOe to KZrdNPIOcs5m If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC jimgraham@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes flutter/flutter#123307 - for Android, iOS, and Web, for the main display only (flutter/flutter#125938 tracks supporting multiple displays, flutter/flutter#125939 for desktop).
Desktop will need to be implemented for this, but given priority for a couple of our customers targetting foldable devices on Android I'm inclined to get this in before desktop can be finished.
The main concern for this right now is that on some Android foldable devices, setting a preferred orientation will cause letterboxing and the
MediaQuery
will never get the full screen size when unfolded. This causes apps to think the screen is smaller than it is, as they've mainly been usingMediaQueryData.size
to figure this out. Android's recommendation is to not set a preferred orientation, and if you must to use the new method introduced inViewUtil.java
to calculate the maximal window size.