Skip to content

Custom picture(s) selector which indicates what pictures have been uploaded already #175

Closed
@nicolas-raoul

Description

@nicolas-raoul

Users 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:

commons-custom-picker

Custom selector:

pictures-browser-with-commons-overlay svg

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 "GPS" 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:

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions