Redth / ZXing.Net.Maui

Barcode Scanning for MAUI?
MIT License
475 stars 150 forks source link

AppShell (Almost) on Windows and Android Reliably: Android Still Broken "on Second Viewing" #162

Open dgerding opened 9 months ago

dgerding commented 9 months ago

Thanks to @paoldev in advance since this request for help is based on work they already delivered toward getting reliable ViewCamera behavior for the scanner in .net maui AppShell navigation contexts.

I've made a repo here based on @paoldev 's AppShell friendly variant (AppShell of #146 ) and demo app. This version works perfectly on Windows.

Problem When I run this on real Android, I get the behavior of the CameraView being black|"disappearing" on the second view of a page with the control. Works first time. Missing|blank on return.

Again, this code works on Windows already with app shell multi-page etc, so I'm hoping those waiting on Android related PRs might see an opportunity to build on paolodev appshell friendlier bits. (Personally, I only have sturdy Android CameraView behavior view a hacky MainPage swap between shellview instance and a scanner page. Yuck. Standard page and appshell behavior better)

Anyone able to get the CameraView instance to persist, reliably, between page views and or (re)init OnAppearing or some other init manage method on Android? Maybe #148? I tried forcing a new camera view instance on (re) appearing but that didn't work either.

Very close to a stable, fully .net maui appshell cross-platform ux thanks to community.

Any help or direction appreciated.

Dave G

Yannikk1996 commented 8 months ago

I have the same error. No solution found for now.

figuerres commented 6 months ago

yes on android i can use the barcode control one time and then i have to close the app .... not a good outcome. if this will not work then i have find a different way to scan qr codes in my app.