Closed morigs closed 4 years ago
I think it was already discussed on Issue https://github.com/ideacreation/react-native-barcodescanner/issues/46.
My setup is:
It was working for me first, but than i ran into the same Performance problems again.
I am using react-native-router-flux. The following problem appears:
Now im back to 2 FPS again and Navigation pop and push is laggy as hell. I think it's somehow connected to the onHostResume function from BarcodeScannerManager
Maybe @andreaskeller has an Idea.
I use react native Navigator. But barcode scene is initial. I don't through Scenes or put app in background.
I just got an Nexus 5X with Android 6.0.1 and experience the same performance problems. On my older HTC One with Android 4.4 up to 5.5 recently everything was much faster. I am looking into it.
I opened a pull request #55 which should solve the problem by using AsyncTask so the UI thread is not blocked.
@AlexSchwabauer i don't know java so can't review PR. But it works fine on my phone for now! :relieved:
@gogamwar Great! I still would recommend to use InteractionManager.runAfterInteractions to mount the component only after all animations are done, since the initial startup is quite heavy. Having state.showBarcodeScanner initially set to false and then
componentDidMount = () => { InteractionManager.runAfterInteractions(() => { this.setState({showBarcodeScanner:true}) }); }
would to the job.
Thanks a lot !
When using JS FPS is always 0, and the app so slow. Any thoughts?