code4romania / mon-vot-android-kotlin

Android election monitoring app - a mobile app through which commissioned observers can easily report back to their respective NGOs throughout the election day
https://votemonitor.org
Mozilla Public License 2.0
7 stars 29 forks source link

Enable upload of multiple files with note #231

Closed lukstbit closed 4 years ago

lukstbit commented 4 years ago

What does it fix?

Closes #28

To allow the user to add multiple files to a note I kept the add media button always visible. To keep the changes to a minimum I reused the old logic, so instead of the string in the Note class referencing a single path it will represent a concatenation of all the paths to be uploaded with the note. The repository can then extract the paths and make the backend request.

How has it been tested?

I tested the changes manually on various API levels. I plan to add some tests at a later point after some code refactoring.

aniri commented 4 years ago

@lukstbit woooh, looks good! could you also add the possibility of selecting more than one item when loading files from gallery?

lukstbit commented 4 years ago

The user can now select one file/multiple files from the gallery in one go!

There is also one extra commit where I refactored the error messages shown to the user when copying the file fails. The previous error messages were about storage permission missing but that will happen quite rarely because we check for the permission every time the user sets to select a file/take picture. A more common error would be insufficient storage and I changed the messages to reflect this. If you don't like the change you could remove the last commit.

Also, one thing that I forgot to mention in the initial post is that the number of files that could be attached is unlimited, the user has the possibility of adding a lot of file with one note. I don't know if this is desired or if there should be a hard limit on the number of files attached to a single note.

aniri commented 4 years ago

@lukstbit looks great, thanks! you are right, we'll check if there are any file restrictions on the backend and get back on this with another issue ;)

btw...are you on the code4ro slack? :smiley:

sonarcloud[bot] commented 4 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

lukstbit commented 4 years ago

@aniri I'm not on code4ro I don't even have a Slack account :)

aniri commented 4 years ago

@lukstbit would you like to join us on slack as well? :D We can send you an email invite :D

lukstbit commented 4 years ago

No, not at this moment. I do plan to implement all the issues currently labeled code4ro-hackdays :)

aniri commented 4 years ago

No, not at this moment. I do plan to implement all the issues currently labeled code4ro-hackdays :)

@lukstbit awesome! thanks a lot!! we'll have so many new features ready for the elections this december :smiley: