Images-to-PDF
Images-to-PDF copied to clipboard
[#1101] Add new feature to allow user scan QR code from saved image
QrBarcodeScanFragment.java: add logical code
drawable: add two xml icons, ic_barcode_from_image_24dp.xml and ic_qrcode_from_image_24dp.xml
modify fragment_qrcode_barcode.xml
modify strings.xml
Description
ScreenShots for the new feature in UI:
Two new buttons
users choose images from the gallery
when the user scanned no corresponding code or no code in the saved image
when the user scanned a detectable code
As I cannot change the UI in the camera scanning interface, I prefer to add two access points for users to choose what they want to do with the QR/bar code scanner, either read from the gallery or the camera. I created two new cards for users to choose whether to scan with the camera or from images from the gallery.
I believe this is the optimal solution while maintaining the speed of the original camera opening and not changing the camera interface. It raises the learning cost for the user. Still, once the user is familiar with it, he/she will find it much more appealing as it doesn't pop up a window asking which one to choose and then has to click again to select it if he/she touches it accidentally by mistake. Large icons and clickable areas reduce the number of accidental touches.
Fixes #1101
Type of change
Just put an x in the [] which are valid.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
- [x]
./gradlew assembleDebug assembleRelease
- [x]
./gradlew checkstyle
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
And new codes are highlighted, it's easy to see what has been changed.
Moreover, I found it was incompatible with my editor when I wanted to do the tests on it. I just made a local change with the test. Nothing more changes
System: macOS 14.0 CPU: Apple M2 Pro EDITOR: Android Studio Flamingo | 2022.2.1
Code Climate has analyzed commit 2a57627f and detected 7 issues on this pull request.
Here's the issue category breakdown:
Category | Count |
---|---|
Complexity | 5 |
Duplication | 2 |
View more on Code Climate.
I will fix these issues.