Skip to content

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

Ali1Assalem/RickMorty

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages