5argon/NotchSolution

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.

Here's what I get on my Huawei (I'm not on the maximum resolution)
screenshot_20190211_212438_com exceed7 notchsolutiondebug
screenshot_20190211_212459_com exceed7 notchsolutiondebug

Note that at startup, the application was displayed as below. The app was displayed normally after going into landscape.
screenshot_20190211_212547_com exceed7 notchsolutiondebug

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!

Hmmm I have one more submission with Essential Phone, it also reports overshooted cutout on the Y axis when landscape. Strange.

image

These are from my OnePlus 6t:

vertical_correct

horizontal

After coming back from landscape, my portrait breaks and displays the orange area on the right:

vertical

There is also this annoying issue that android's getSafeInsetBottom() doesn't consider the bottom rounded corners. Which ends up cropping the corners of the image.

croppedborders

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.

That's what I get on my Huawei Mate 20 Pro
Screenshot_20190322_214634_com Exceed7 NotchSolutionDebug
Screenshot_20190322_214559_com Exceed7 NotchSolutionDebug

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.

Screenshot 2019-04-27 17 58 57

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 ?

Screenshot 2019-04-27 17 59 08

Rotating back, I could get the correct landscape.

Screenshot 2019-04-27 18 08 24

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.

Screenshot 2019-04-27 18 01 56

Screenshot 2019-04-27 18 02 00

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.

27595

27596

I also got a friend whose friend got a non-plus variant Galaxy S10, so here it is! On this version the camera at the hole reduced to a single, thus about a half smaller. Thank you MiNiKooNG's friend who I don't even know!

461981
461982

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.

68687830_499946500837693_229490956007636992_n

68750706_518316112044467_7273309820495593472_n

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.

Hey there. We have been fighting with notch for a bit, and found this thread and your plugin!

Attaching info about my galaxy s10. It's shows different resolution, than your friend has:
image
image

Also did simulated double notch to see what happens:
image