Skip to content

[#1101] Add new feature to allow user scan QR code from saved image#1141

Open
ShinChan1420 wants to merge 5 commits intoSwati4star:masterfrom
ShinChan1420:master
Open

[#1101] Add new feature to allow user scan QR code from saved image#1141
ShinChan1420 wants to merge 5 commits intoSwati4star:masterfrom
ShinChan1420:master

Conversation

@ShinChan1420
Copy link
Copy Markdown

@ShinChan1420 ShinChan1420 commented Oct 18, 2023

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
image

users choose images from the gallery
image

when the user scanned no corresponding code or no code in the saved image
image

when the user scanned a detectable code
image

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)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

  • ./gradlew assembleDebug assembleRelease
  • ./gradlew checkstyle

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • 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

image

QrBarcodeScanFragment.java : add logical code

drawable: add two xml icon, ic_barcode_from_image_24dp.xml and ic_qrcode_from_image_24dp.xml

modify fragment_qrcode_barcode.xml

modify strings.xml
@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 2a57627 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.

@ShinChan1420 ShinChan1420 changed the title Fixing issue #1101 in an Alternative Way [#1101] Add new feature to allow user scan QR code from saved image Oct 18, 2023
@ShinChan1420
Copy link
Copy Markdown
Author

I will fix these issues.

@ShinChan1420
Copy link
Copy Markdown
Author

This PR is ready for merge, the code I changed could be retrieved from 09116d5 and 220d0d6 with comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scan QR code from saved picture

1 participant