Custom picture(s) selector which indicates what pictures have been uploaded already
See original GitHub issueUsers can upload images from the app by tapping the “+” button of the main activity and tapping the “gallery” button which calls Android’s built-in picture selector. This issue would introduce a custom picture selector, which shows whether each picture has been uploaded to Commons already or not. This is useful because after a long trip it is difficult to remember what pictures you have uploaded already.
The custom selector would show a gallery of thumbnails where already uploaded pictures are faded out and have a Commons logo overlay.
Sketch UI
New button to select the custom picture selector:
Custom selector:
In the example above, you can see that I have already uploaded the 4 pictures on the right, but not the two pictures on the left. Seeing this, I can decide whether I want to upload the first picture or not, given I have arguably already uploaded a better picture (with less cars).
Requirements
- Show thumbnails.
- Let the user switch to another folder.
- Scrolling must be smooth, so that I can skip 100 pictures without waiting much
- Show differently images that have been uploaded already.
- To check whether a picture has been uploaded already or not, use the API (see below), as pictures may have been uploaded via a different device, or the user may have uninstalled/reinstalled the app.
- Results from the API must be cached, so that when I open the picture selector again the same API requests are not called again.
- API calls must not prevent scrolling (asynchronous).
Bonus
Would be nice, but not strictly required:
- Long-press to preview the image fullscreen.
- Also show a “<strike>GPS</strike>” overlay icon for pictures that do not have EXIF latitude/longitude.
Strategies
- You could reuse an open source gallery like https://github.com/nostra13/Android-Universal-Image-Loader which is reused by many applications, but please make sure that:
- The library’s license is compatible with our app’s license.
- Our app’s APK size does not grow by more than 1 MB (in other words, the library is not too big).
- The library is either maintained, or has less than 10.000 lines of code, reasonably well-written.
- It allows the customization described above.
- Or you could implement a simple picture selector from scratch (it might be the only solution if no suitable library is found).
API
Commons has a simple API to check the presence or not of a file, it works by sending the SHA1 checksum to the URL https://commons.wikimedia.org/w/api.php?action=query&list=allimages&format=xml&aisha1=<put SHA1 here>
. Examples:
- https://commons.wikimedia.org/w/api.php?action=query&list=allimages&format=xml&aisha1=579330b110c605f7984f7ef6161e3ef8a417ef96 : We see that this image has been already uploaded.
- https://commons.wikimedia.org/w/api.php?action=query&list=allimages&format=xml&aisha1=da39a3ee5e6b4b0d3255bfef95601890afd80709 : We see that this image has not yet been uploaded.
The API is quite slow (around 1 second per request), which is why caching and asynchronous loading is needed. The selector must be usable even if Internet is extremely slow or disconnected.
Issue Analytics
- State:
- Created 7 years ago
- Comments:45 (26 by maintainers)
Top GitHub Comments
Congratulations @4D17Y4 ! Glad to have you on board. 😃
Glad to announce that the project is merged with master.
Thank you everyone for all your inputs, would love your feedback on the Brand New Custom Selector. Special mentions to @nicolas-raoul and @madhurgupta10 for guiding me throughout the project.
Thanks.