Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submission thread : notch information as returned by Unity's API research #2

Open
5argon opened this issue Feb 11, 2019 · 13 comments
Open
Labels
help wanted Extra attention is needed

Comments

@5argon
Copy link
Owner

5argon commented Feb 11, 2019

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.

@06Games
Copy link
Contributor

06Games commented Feb 11, 2019

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

@5argon
Copy link
Owner Author

5argon commented Feb 11, 2019

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!

@5argon
Copy link
Owner Author

5argon commented Feb 12, 2019

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

image

@AAulicino
Copy link

AAulicino commented Feb 21, 2019

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

@rjonaitis
Copy link

The cutout's Y coordinate update and initialization until first orientation change has been fixed in Unity 2019.2.0a7

@5argon
Copy link
Owner Author

5argon commented Mar 3, 2019

When 2019.2.0a7 is out I will rebuild the APK. (Currently a4)
For now please do not submit any more images. Thank you.

@5argon
Copy link
Owner Author

5argon commented Mar 22, 2019

I have rebuilt the APK using 2019.2.0a9, and put in in the release page instead of in the repo.

@06Games
Copy link
Contributor

06Games commented Mar 22, 2019

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

@5argon
Copy link
Owner Author

5argon commented Apr 27, 2019

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

@5argon
Copy link
Owner Author

5argon commented May 29, 2019

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

@5argon
Copy link
Owner Author

5argon commented May 29, 2019

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

@5argon
Copy link
Owner Author

5argon commented Aug 23, 2019

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.

@Kendja
Copy link

Kendja commented Apr 29, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants