Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set card scanned with "Select image from gallery" as photo #1157

Closed
wants to merge 2 commits into from

Conversation

liutng
Copy link
Contributor

@liutng liutng commented Dec 9, 2022

This Pull Request fixes #1057.

The changes are listed below.

Implemented

  • Added a feature that automatically sets the front/back image with the scanned barcode. There will be a dialog shown to the users to confirm if they want to automatically set the image or not.

Code changes

  • Added frontUserDefined and backUserDefined to LoyaltyCardField to distinguish if the image of the front and back card was added automatically or manually.
  • Added 2 more columns(frontuserdefined and frontuserdefined) to the table of LoyaltyCardDbGroups.
  • Bumped up the database version from 15 to 16.
  • Added database upgrading code to migrate the database from version 15 to 16.
  • Added logic code to display a dialog letting users select if they want to automatically set the scanned barcode as the front/back image of the current card.
  • Added the file's URI of the scanned barcode to the intent so that LoyaltyCardEditActivity could use it to set the front/back image.
  • Changed Test files to reflect the changes of DBHelper.

Potential Issues

  • Might need to check if the current logic of automatic card adding is appropriate (especially for card rescanning).
  • The prompted image-setting dialog may be ungrammatical or could be more concise...

@TheLastProject
Copy link
Member

I don't think database changes are actually necessary for this feature.

When I said this:

We will need to think and test if this will feel correct when re-scanning. Perhaps a flag should be set on the front or back photo that the image was "automatically set" and thus can be overwritten in step 4 or 5 until the card is saved.

I meant something like setting a variable in the LoyaltyCardEditActivity so that if an user while editing a card repeatedly:

  1. Clicks Edit Barcode
  2. Clicks Select image from gallery

it won't first set the front image, then the back image, then asks.

The more I'm thinking of this though, the more I feel this whole feature might have been a bad idea. It is just a few clicks to add an image explicitly and it's not really user-friendly to do things automatically or bother users with questions. The few people who want this can just manually set this.

Thank you a lot for giving this a try though, I really appreciate that, and I'm sorry for taking so long to respond and deciding to not include this feature after all.

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.

Set card scanned with "Select image from gallery" as photo
2 participants