Submission thread : notch information as returned by Unity's API research
5argon opened this issue ยท 13 comments
I want to conduct a research what would Unity returns for Screen.safeArea
(new in 2019.1) and Screen.cutouts
(new in 2019.2). I have made an APK from Unity 2019.2 alpha that returns those information. Help appreciated!
- Download the APK in the release page.
- Then install on your Android with file manager or
adb install -r
(r = replace). - After it runs, rotate the device to both portrait and landscape and take 2 screenshots to remember information of landscape and portrait safe area & others as reported by Unity.
- Paste those screenshots here! Thank you!
The experiment's data will be used to make a new UI component in the future which could avoid the actual notch rectangle, not just pad according to the safe area like SafeAreaPadding
.
I see that it kind of working! Thanks!
The code runs Update
repeatedly and refresh the red border + all texts every frame, so surely having to do one orientation change first is not some kind of initialization timing issue. Maybe we need Unity to fix it.
Also horizontal cutout's Y coordinate is way out of the screen!
The cutout's Y coordinate update and initialization until first orientation change has been fixed in Unity 2019.2.0a7
When 2019.2.0a7 is out I will rebuild the APK. (Currently a4)
For now please do not submit any more images. Thank you.
I have rebuilt the APK using 2019.2.0a9, and put in in the release page instead of in the repo.
I would like to add some image from the iOS simulator as well. The cutout fits perfectly. Also you see what's great about iPhone's safeArea
is that it already accounts for the curved screen corner. If you stay inside the safeArea
, you are also safe from corners.
The first startup seems to still have a wrong orientation if the simulator is currently landscape. This is built with 2019.2.0a13, is this expected to be fixed already from 2019.2.0a7 or is it a new bug @rjonaitis ?
Rotating back, I could get the correct landscape.
On iPad Pro there is no cutout, but there is a 40px padded safe area for the black line. *also you are not safe from that little rounded corner since there are no safe area on other sides.
I was fortunate to receive cutout information of the latest Galaxy S10+ with that corner hole from my friend. (Thanks @pj4dev !) Here they are if someone wants to make me a mockup overlay for it.
My same friend MiNiKooNG already got the new Note 10+, so here is the info. He said the center hole actually skewed to the bottom of the rectangle, but anyways the frame looks right.
I think this is a device with the smallest center notch so far. We are more likely want to do nothing as if the hole didn't exist in this case, unfortunately safe area cannot distinguish it.