Introduce method .hasCutHole()
See original GitHub issue## Description
With cut holes being introduced in 2019 (Samsung S10) it would be great to have a .hasCutHole()
method that would return an Array with where the cut holes are located or an empty array if no cut holes are present. However, it might be more appropriate to maybe add this to the .hasNotch
method. Returning an object describing if it is a cut hole or a notch and if it is a cut hole, specifying its location.
if left and right cut holes -> ['left', 'right']
// Mi Mix 4 patents show dual cut holes
if only left -> ['left']
no cut holes -> []
## Use Case
Some of my Apps hide the Status Bar and the newly introduced cut holes now interfere with some critical buttons.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Introduce method .hasCutHole() · Issue #594 · react-native ...
hasCutHole() method that would return an Array with where the cut holes are located or an empty array if no cut holes are...
Read more >weixin_39881859的博客_CSDN博客-领域博主
Base ref when is relative. 2021-01-12. Introduce method .hasCutHole(). 2021-01-12 ... 2021-01-12. Introduce method .hasCutHole(). 2021-01-12 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m also discovering the thing, wow 😄
About BC: we will be releasing 1.0.0 soon (#307) and adopting a strict semantical release after that. So no harm would be done if we raise to 2.0
But I’ve got a feeling that after notch, cut hole, punch-hole, something else will soon emerge.
I also don’t like at all how hasNotch() is implemented right now: a growing list of devices, sometimes it’s the same, but spelled differently. I’d hate to see this replicated for punch hole.
Maybe it’s time to rethink the static data structure a bit, and be able to handle hasNotch, hasCutHole, and all future derivatives from a single point.
WDYT?
There is upstream work for this - there’s a PR that might land soon that would allow for layout that respects sensor clusters https://github.com/facebook/react-native/pull/20999