Giter VIP home page Giter VIP logo

list-of-products's Introduction

Grid List and Bottom Sheet

Overview

Android application that displays a list of images with description. The data for these images is fetched from this API. Demo Video

Demo

Architecture

The app uses Clean Architecture principles + MVVM Pattern, for a clear separation of concerns across these layers:

Data Layer

Focused on data management, it uses:

  • Room Database for local data storage.
  • Retrofit2 for API interactions.

Components include:

  • Repositories
  • Mappers
  • Local data storage modules
  • Remote data retrieval modules

Domain Layer

Encapsulates the app's core logic and functionalities with:

  • Use cases (e.g., Fetching a list of images)
  • Domain models
  • Data repository interfaces

Presentation Layer

Handles the user interface and interactions with:

  • ViewModels for UI logic.
  • UI Screens designed using Jetpack Compose.
  • Utility functions.
  • Reusable UI components also built with Jetpack Compose.

Configuration Change

The app handles configuration changes like screen rotations using:

  • ViewModel: Ensure that ViewModel retains data across configuration changes. Also, annotated with @HiltViewModel, which means it's managed by Hilt and will survive configuration changes.
  • State: using StateFlow and MutableState to manage the state in the ViewModel.
  • Jetpack Compose: Provides a more intuitive way to handle UI state without the complexities of traditional Android UI development.

Libraries

The application integrates a variety of libraries:

  • Room: Database operations.
  • Dagger/Hilt: Dependency injection.
  • Retrofit2 + GsonConverter: API interactions and JSON data processing.
  • Coroutine: Asynchronous operations.
  • Jetpack Compose/Material3: UI development.
  • Coil: Image loading in Jetpack Compose.
  • JUnit and Mockito: Unit testing and data mocking.

Testing

Unit tests are in place to validate the app's functionality:

  • ViewModels
  • common and Utils

To improve

  • Load data using pagination
  • Persist data into local database only when there is new update (e.g; condition based on a dateTime value returned with api that contains last update time)

list-of-products's People

Watchers

Ahmed Nezhi 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.