question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 5 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
machourcommented, Mar 14, 2019

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.

const devicesFeatures = {
  `oneplus`: [
      {
          // one of the declination, easy to understand for us
          model: '6',
          // could be enhanced by dynamically removing the brand
          aliases: ['ONEPLUS A6000', 'ONEPLUS A6013', 'A6000'] 
          // hardcoded features, absence means false
          notch: true,
          foldable: true,
          punch: false,  // <- could be skipped
          // proposal for punch zones, but probably could be enhanced
          punchZone: {x: 20, y: 30, w:50, h: 50, r: 50 }, 
      },
      // ..
   ],
  // ..
}

WDYT?

1reaction
mikehardycommented, Apr 2, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found