Add button to toggle full screen scanning mode#6918
Add button to toggle full screen scanning mode#6918grzesiek2010 merged 26 commits intogetodk:v2025.3.xfrom
Conversation
|
Looking good so far! |
|
Looks great and it's much faster. The extended fab is delightful. I noticed we lost the bottom bar with the back button. You can pull up and it appears but I didn't realize that at first. |
I made the screen edge to edge and full screen (we hide the system bars). Newer Android phones default to gestural navigation (pull from the side for back, from the bottom to go home) so this works well, but it definitely isn't as nice with 3 button nav. To solve this I think there are three good options:
I think I'd prefer 2: I think keeping the nav bar obviously covers a bit of the camera preview, but it feels like a small trade-off (especially in gestural mode) for slightly easier navigation. |
| - run: | ||
| name: Check APK size isn't larger than 13MB | ||
| command: ./check-size.sh 13631488 | ||
| name: Check APK size isn't larger than 13.1MB |
There was a problem hiding this comment.
I'm guessing this is new icons.
I'm not sure which APK you're referring to, but all that's happened (intentionally anyway) is to introduce the full screen mode.
Good point. That almost suggests to me that there might be something else in frame that it thinks is a barcode. @srujner are you able to get this consistently and with just the barcode screen (no other text or symbols etc). |
After having spent 2 days testing the "rotate device" button I'm still confused - I don't know how to hold the device when the scanner is in the full-screen mode after tapping "rotate device" to get best scanning. I'm thinking about the case of Redmi 9t and scanning the PDF 417 in the ID:
Other devices can scan the barcode in this case but I think it's an example that I don't know what I should do with my device after tapping "rotate device" - @seadowg @alyblenkin should I hold the device in horizontal or vertical position to scan a barcode? |
|
@seadowg I checked in #6784 and I was not able to get any scans of PDF417, either full or partial, but maybe my hand is not as steady as yesterday.
Yes on Pixel 3a and Samsung M23 almost every time, sometimes after ~5 seconds, other time around 30 seconds and I have only that one barcode on the screen. The answer of partial is different every time but it's always sequence of numbers. |
|
First answers for @dbemke:
We'd already discussed only using Pixel devices for testing compact PDF417 in #6916 right? Does the Redmi 9t not always have problems scanning the code no matter what we do?
I don't really understand what you mean by the "start" here. If you hit "Rotate device" the full camera view should be used to scan - any barcode within the frame should be eligible.
Is that even after a2fe822? I fixed a problem where the full view wouldn't be used sometimes (it was still restricting to the view finder even when it wasn't displying).
Can't scan it? Again is that after the change at a2fe822?
To scan a compact PDF417 I'd expect you to need to hold the device horizontally or rotate the barcode itself after tapping "Rotate device". Those particular barcode are generally too wide to fit in the frame while also being readable for a standard mobile device. And answers for @srujner:
I'll have a go and see if I can reproduce. To be clear, I mean absolutely nothing on screen: in the video there's desktop UI which could be confusing the scanner. |
Now I can scan the barcode easily if I open the scanner in the landscape view (on Redmi 9t).
The start pattern of the barcode. In my experience when it comes to PDF 417 if you try to scan it upside down (so the start pattern is on the right) it is more difficult for a device to scan it |
Oh interesting! I would imagine the model finds it slightly harder to scan barcodes that aren't positioned "canonically" as you'd imagine there'd be a bias in the training data. I'd generally expect people to try and position their device so that the barcode fits in correctly (the right way up) from their perspective though. |
Yup, I can reproduce! I've been debugging and playing around with showing myself where the barcode is, and it seems like I'm able to occasionally get a UPC barcode within our PDF417. It seems to be wide, short sections that can fool it. My guess is that these are only likely if you're scanning a code blown up on a screen, and I'm not sure how we can prevent these while still allowing the scanner to support any barcode (rather than having form designers state which one they expect). Does it feel like we need to fix it @srujner or is it hard enough to get that we can probably allow it? |
|
@seadowg I think we can let this one go. |
I think I found out why I feel I use 2 different ways of scanning barcodes in the landscape view. I added it to the Redmi 9t #6774 issue. The rotate button isn't involved. |
|
Tested with success Verified on device with Android 16, 10, 11 Verified cases:
|
|
Tested with success Verified on device with Android 8.1, 10, 16 Verified cases:
|
|
Tested with success Verified on device with Android 10, 12 and 14 |
| <string name="barcode_scanned">Barcode erfolgreich gescannt</string> | ||
| <!--Label for button that exits barcode scanning after success--> | ||
| <string name="exit_scanning">Fertig</string> | ||
| <!--Label for button that exits barcode scanning after success--> |
There was a problem hiding this comment.
Is it ok to change the indentation here and in other string files?
There was a problem hiding this comment.
This seems to happen automatically when deleting strings with the "Translations Editor" annoyingly. The files will be replaced when we update translations, so I don't we should bother taking the time to fix it.
qr-code/src/main/java/org/odk/collect/qrcode/ScannerControls.kt
Outdated
Show resolved
Hide resolved
qr-code/src/main/java/org/odk/collect/qrcode/ScannerControls.kt
Outdated
Show resolved
Hide resolved
qr-code/src/main/java/org/odk/collect/qrcode/ScannerControls.kt
Outdated
Show resolved
Hide resolved
grzesiek2010
left a comment
There was a problem hiding this comment.
I've left a couple of comments.
Add button to toggle full screen scanning mode
Closes #6913
Blocked by #6916Why is this the best possible solution? Were any other approaches considered?
I switched to Compose for the scanner controls here as I really wanted
@Previewso that I didn't have manually test the combinations of full screen mode and rotations - I'm glad I did as it was super helpful!Other than that, there's not a lot to mention. I'll leave comments inline for anything that might need it.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
The only thing that's changed is again the barcode (and reconfigure QR code scanner). The behaviour is basically the same as in #6916, but there is now a button that allows the "full screen mode" to be toggled from either orientation.
For the older scanner: I've made sure the rotate button does not appear and locked the orientation to portrait. This is not a long term solution, and we'll have to resolve as part of #6647.
There's also an ongoing conversation around whether we keep the current "full screen" look below.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest(or./gradlew testLab) and confirmed all checks still passDateFormatsTest