GithubHelp home page GithubHelp logo

ali1assalem / rickmorty Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 2.0 1014 KB

MVVM ,Hilt DI ,Paging3 , RemoteMediator ,LiveData ,Flow ,SharedFlow ,Room ,Retrofit ,Coroutine , Navigation Component ,DataStore ,DataBinding , ViewBinding, Coil

Kotlin 100.00%
coroutines databinding hilt-dependency-injection livedata retrofit2 room sharedflow paging3 remote-mediator

rickmorty's Introduction

RickMorty

This is a simple app which has been implemented using Clean Architecture alongside MVVM design to run (online/offline) using :
[ MVVM ,Hilt DI ,LiveData ,Flow ,Room ,Retrofit ,Coroutine ,
Navigation Component ,DataStore ,DataBinding , ViewBinding, Coil ]

Also I used the free API https://rickandmortyapi.com/api the content of app. IT CONTAINS A SINGLE ACTIVITY WITH A SIMPLE UI. And the goal of sharing this code is to have a better understanding of the techniques I mentioned above for newbies.

Main Features 📚

  1. Kotlin
  2. MVVM - Single Activity Architecture
  3. DataBinding - ViewBinding
  4. Flow - LiveData
  5. Coroutine
  6. Hilt DI
  7. Paging3 , RemoteMediator
  8. Room
  9. Navigation Components - Safe Args
  10. Retrofit2
  11. Coil

App Architecture


Screenshots








Advantages Of Using Single Activity Architecture

  1. From the name only we can understand that only one Activity will exist in the whole architecture. So, no need to update the Manifest every time. Just once, we have to declare the Navigation graph XML file in the Manifest.
  2.  No need to declare the boilerplate method like startActivityForResult() every time as we will navigate between the fragments now and the navigation between the fragments get also simplified with the use of the Navigation Component library included in JetPack.
  3. The transition Animation problem has also been resolved after using the fragments.
  4. As all the Fragments will be bounded inside the Activity, we can easily share the data between the fragments.
  5. We might counter incidents like we need to pass information to the fragments. It may consist of nullable data. Manually, if we have to resolve this problem then we have to write several lines of code. But in Navigation Component, Android introduced a feature called “Safe Args Gradle Plug-in”. Builder classes will be generated from this plug-in to assure type-safe access to the arguments for the particular action.

BENIFITS OF NAVIGATION COMPONENT

Navigation Architecture Component provides a number of benefits, including:

  • Automatic handling of fragment transactions
  • Correctly handling up and back by default
  • Default behaviors for animations and transitions
  • Deep linking as a first class operation
  • Implementing navigation UI patterns (like navigation drawers and bottom nav**)** with little additional work
  • Type safety when passing information while navigating
  • Android Studio tooling for visualizing and editing the navigation flow of an app


Author

@ALI

rickmorty's People

Contributors

ali1assalem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.