question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

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:closed
  • Created 7 years ago
  • Comments:45 (26 by maintainers)

github_iconTop GitHub Comments

5reactions
misaochancommented, May 31, 2021

Congratulations @4D17Y4 ! Glad to have you on board. 😃

3reactions
4D17Y4commented, Aug 18, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uploading Images into Design Space - Cricut - Help
Design Space gives you the ability to upload your own images and converts them into cuttable shapes. There are two different types of...
Read more >
Add picture control in canvas apps - Microsoft Learn
The Image control shows the uploaded image or a placeholder if no image has been uploaded. The Add picture button prompts for an...
Read more >
Display images and documents - AppSheet Help
For custom images, we generally recommend using square images: 600x600px. Images in a detail view. The detail view has a main image. The...
Read more >
ImagePicker - Expo Documentation
expo-image-picker provides access to the system's UI for selecting images and videos from the phone's library or taking a photo with the camera....
Read more >
Page and media selectors for page builder components
The media files selector form component has the following configurable properties: ... A URL of the selected image is then retrieved in the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found