Coder Social home page Coder Social logo

gallery's Introduction

Gallery

A gallery app to load and display images from Lorem Picsum. The source data for the app is https://picsum.photos/v2/list

Written in Java

Libs

  • RxAndroid: Android wrapper for RxJava for async events based observable pattern.
  • Retrofit: HTTP Library.
  • Gson: Used for data serialization and modeling with Retrofit.
  • Parceler: Used for making custom data model objects more easily passed between activities.
  • Glide: Image loading and caching library
  • PhotoView: Used for the full-screen image view to support pinch-zoom and panning.
  • SpinKit: Pretty animations lib used for initial loading animation.

Highlights

  • When images are downloaded from Lorem Picsum, Glide caches them locally to memory and disk. This local cache is referenced before the app tries to re-download any images over the network again.

  • The gallery view can be refreshed from Lorem Picsum by pulling down at the top of the gallery list. Previously selected sort options apply.

  • ViewModels are used to persist app data between configuration changes (screen rotation, split screen, etc.)

  • The sorting methods (by Author name and by image area) are totally custom. This was done for the additional challenge. To avoid stack overflow problems, the sort methods use a stack structure to load and unload operations.

    • Author name sort is performed using a Trie structure to sort alphabetically. This works by creating a tree structure based on the letters in the name, and then running a pre-order depth-first-search to flatten the tree. Non English characters are ignored for the sake of this exercise. (Images with author names consisting of entirely non-english or illegal characters will appear at the front of the gallery).
    • Image area sort uses Quicksort. The images display in smallest to largest area.
    • Unit tests can be found for these sort methods here.
  • Tapping an image in the gallery loads it in a full-screen view where the image can be zoomed by using a pinch gesture, or panned by using two fingers.

  • Tapping the bar with the author's name and (i) icon reveals a modal web view that takes you to the web page for the image to view more details or related images.

    • Both the back button and Android back button will first navigate back in the web view. If there are no more pages to go back to, the web info modal will then close.
    • You can also tap outside the modal window to dismiss it at any time.

gallery's People

Contributors

carlpoole avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.