Closed kruyvanna closed 6 years ago
Nice, thanks. I'll take a look soon and merge it!
Hi, with further testing, it's not fully fixed yet. I will let u know when I get new update.
I finally found the cause. Turns out setting child size bigger than it's parent is the culprit.
I changed fillLayout() to fitLayout() in previewLayout()
I don't know how to make fillLayout() works though.
This is the project to reproduce the bug https://github.com/kruyvanna/react-native-barcode-scanner-google-black-view-bug
Thank you very much, been attempting work around that problem for quite some time, never crossed my mind that could be the issue. Since I am also looking into keeping fillLayout, I will as well give it a go at why it breaks.
@srolija great! looking forward to hearing from you
There were some good observations in this PR, but I feel like it's a bit of a hack that fixes the issue at the expense of modifying intended behaviour of the module. I made a long comment about this and pushed a (hopefully) more thorough fix for this. Read more: https://github.com/ekreutz/react-native-barcode-scanner-google/issues/4
Closing this for now. Thanks for putting in the hard work, it was definitely helpful in solving the issue!
If you are planning to use it in the production app, I would highly recommend you to check the RNCamera instead, at the time this was without the doubt the only library that worked performantly enough on Android, but during the last two years, things drastically changed. And while RNCamera was constantly updated, this one remained the same. My personal experience is that moving to that library drastically lowered the number of issues arriving into Sentry from dozen a week to a few a month.
You can find more details in another issue on this same issue tracker: https://github.com/ekreutz/react-native-barcode-scanner-google/pull/7#issuecomment-528620721.
When used with navigation, the barcode scanner view remains on top of other view with black background.