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

Added ability to import a barcode from a local image #51

Closed
TheLastProject opened this issue Oct 24, 2020 · 13 comments
Closed

Added ability to import a barcode from a local image #51

TheLastProject opened this issue Oct 24, 2020 · 13 comments
Labels
type: enhancement New feature or request

Comments

@TheLastProject
Copy link
Member

Issue by franga2000
Monday Oct 14, 2019 at 18:43 GMT
Originally opened as brarcher/loyalty-card-locker#317


Adds an "Import from image" button next to "Capture card" that does exactly what was described in #248 - allows the user to pick an image from their device that contains the barcode they want to add.

Signed-off-by: Miha Frangež<[email protected]>


This change is Reviewable


franga2000 included the following code: https://github.com/brarcher/loyalty-card-locker/pull/317/commits

@TheLastProject
Copy link
Member Author

Comment by brarcher
Sunday Oct 27, 2019 at 03:51 GMT


Pretty cool!

Are you up for adding some Robolectric tests for this new feature? Much of the app has automated tests, which helps prevent breakage and regressions.

@TheLastProject
Copy link
Member Author

Comment by franga2000
Sunday Oct 27, 2019 at 07:12 GMT


Sure. I'm not familiar with Robolectric, but I'll look into it.

@TheLastProject
Copy link
Member Author

Comment by TheLastProject
Wednesday Nov 20, 2019 at 09:11 GMT


I'm quite interested in this feature too. I don't normally do Android development but I'm willing to try to help if useful

@TheLastProject
Copy link
Member Author

Comment by franga2000
Wednesday Nov 20, 2019 at 10:06 GMT


I got a bunch of uni work dumped on me so I haven't had any time to work on this. It looks like I'll be clear beginning of December, so you can expect this finished around then.

@TheLastProject thanks for the offer. I'm not sure GitHub would be very happy about mixing remote branches in one PR, but it's been a while since I've tried. If you can wait the two weeks, it's probably not worth the hassle of setting up Android Studio 😅

@TheLastProject
Copy link
Member Author

Comment by TheLastProject
Wednesday Nov 20, 2019 at 10:59 GMT


Okay, I'll just wait then :)

@TheLastProject
Copy link
Member Author

Comment by franga2000
Thursday Nov 28, 2019 at 00:01 GMT


I've been working on testing image importing by generating a barcode image, saving it and sending a fake pick intent response to the app. I have discovered, however, that the version of Robolectric used here doesn't actually implement image compression and is as such unable to save images to disk in a way that can read back.

It seems that the feature was only implemented in v4.3.1. While the actual migration to v4 and up is not too difficult, it does, however, require compiling on SDK 28 or higher.

Should I try to migrate the project to a newer version of Robolectric?

@TheLastProject
Copy link
Member Author

Comment by TheLastProject
Thursday Nov 28, 2019 at 06:41 GMT


I actually did a migration to Roboelectric 4 in my pull request in the hope it would fix things for me. It sadly didn't, but you may still want to take a look at brarcher/loyalty-card-locker@0a9611e to save yourself some time if you end up going that path

@TheLastProject
Copy link
Member Author

Comment by brarcher
Friday Nov 29, 2019 at 04:30 GMT


While the actual migration to v4 and up is not too difficult, it does, however, require compiling on SDK 28 or higher.

The Play Store has a target SDK requirement which updates each year. As of Nov 1 this app will need to compile against SDK 28, else an update cannot be pushed to the Play Store.

https://support.google.com/googleplay/android-developer/answer/113469#targetsdk

If you would be so kind as to update it to 28 (or 29) that would be much appreciated. I'm also fine with updating the version of Robolectric being used to the latest.

@TheLastProject
Copy link
Member Author

Comment by brarcher
Tuesday Dec 31, 2019 at 03:52 GMT


Should I try to migrate the project to a newer version of Robolectric?

To follow-up, brarcher/loyalty-card-locker#334 recently was accepted which updates the SDK version compiled against to 29 and updates Robolectric to 4.0.2.

If you are willing to upgrade the version of Robolectric used from 4.0.2 to 4.3.1 go for it. I've not looked into it; hopefully nothing that the existing tests use is deprecated and removed between those two versions. If you run into snags, let me know.

@TheLastProject
Copy link
Member Author

@franga2000 Are you still interested in working on this? Otherwise I'll see if I can integrate this into Catima myself.

@mgohin
Copy link

mgohin commented Mar 24, 2021

I just got the app, and can't migrate from my old app (Fidme) to Catima quickly.
I don't own cards I added in Fidme anymore, so this feature would help me migrate 👍

@TheLastProject
Copy link
Member Author

I'll take a look at doing the cleanups and writing the tests in #150 myself. I'll also try to support Fidme's export format in #168 (the GDPR is so amazing for requiring users to be allowed to export their data).

@TheLastProject
Copy link
Member Author

Fixed in c93b752, going to give the translators a few days to translate stuff and then I'll push out a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants