Skip to content

islamarr/shutterstock_image_list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ShutterStock

GitHub followers GitHub Repo stars GitHub forks

About this project

πŸš€ List of awesome pictures from ShutterStock.

πŸ›  Simple implementation for MVVM architecture pattern and clean code.

πŸ›  SOLID principles.

πŸ›  Unit tests included.

πŸ›  Standard Coding Style.

πŸ›  Support Tablet screens.

Challenges

  • Performance and smooth scrolling: I was in need to pagination to keep the app in high performance by reducing server overhead and improve response time. I have used Glide which is a fast and efficient image loading library uses memory and disk caching by default to avoid unnecessary network calls.

Architecture pattern Used

MVVM

architecture pattern

Libraries & Tools Used

  • Foundation - Components for core system capabilities, Kotlin extensions and support for multidex and automated testing.
  • Test - An Android testing framework for unit and runtime UI tests.
  • Architecture - A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
    • Data Binding - Declaratively bind observable data to UI elements.
    • Lifecycles - Create a UI that automatically responds to lifecycle events.
    • LiveData - Build data objects that notify views when the underlying database changes.
    • Navigation - Handle everything needed for in-app navigation.
    • ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
    • Repository - A Module that handle data operations, You can consider repositories to be mediators between different data sources.
    • Kotlin Flows - A stream of data that can be computed asynchronously.
    • Paging 3 - For loading and display pages of data from a larger dataset from local storage or over network.
  • Third party and miscellaneous libraries
  • Other tools/plugins
    • SonarLint plugin - Static Code Analysis that identifies and helps you fix quality and security issues as you code.
    • Espresso test recorder - Tool lets you create UI tests for your app without writing any test code.

Technical choices

MVVM vs MVP

  • Loose coupling between View & ViewModel, ViewModel has no reference to the View. So it isn't affected by configuration changes.
  • Aware by lifecycle. ViewModel save data even after rotate mobile.
  • Easy to Test.

RecyclerView vs listview

  • In RecyclerView, it is mandatory to use ViewHolder pattern Which optimize the performance.
  • DiffUtil callback Which optimize the performance.

Activities vs Fragments

  • I have used a single-activity architecture which allowed me to take full advantage of the Navigation component, which mean that a single activity that manages and host multiple fragments.
  • The fragment is more lite weight than Activity.

Hilt vs Dagger2 vs Koin

  • Hilt is built on top of the Dagger, and it comes with some advantages like simplify Dagger code and create a standard set of components and scopes to ease setup.
  • As this project is simple, Hilt is the best one. For more complex projects I will go with Dagger2 to avoid some limitation of hilt.
  • Hilt does not need factories for ViewModel, koin need.
  • Hilt generate the code in the compile time, while koin in runtime.

Coroutines vs RxJava

  • For me, Coroutines are simpler & readable than RxJava, and it is working very well in a small projects like that. In more complex projects may be RxJava is better to get benefit of their operators, and to handle a complex data flow. However, Coroutines have some advantages over RxJava like Channel.

Retrofit vs Volley

  • For me, Retrofit has a well-designed code, more readable.
  • Recommended by Google.

Glide

  • Glide very effective for almost any case where you need to fetch, resize, cache and display a remote image.
  • Support round pictures, thumbnail and placeholder which I needed in this project.

What's next

  • I wish I could have implemented caching data, but found problems that will take some time, so maybe complete it in the coming iteration.
  • Also the UI needs to be much fancier.
  • Unit tests are still need to be written.
  • I wish I could have extend it to Clean Architecture, maybe update it in the coming iteration.

Other Projects

Sona3 Recorder Prayer Now Mn Ahyaha