Skip to content

Tanmeet03/ModelViewIntent

Repository files navigation

Special thanks to codingwithmitch.com

Number Fact application

Get to know some amazing facts about

  1. Date
  2. Year
  3. Number
  4. Random facts
  5. Trivia

Model View Intent

MVI stands for Model-View-Intent. MVI is one of the newest architecture patterns for Android, inspired by the unidirectional and cyclical nature of the Cycle.js framework.

MVI works in a very different way compared to its distant relatives, MVC, MVP or MVVM. The role of each MVI components is as follows:

  1. Model represents a state. Models in MVI should be immutable to ensure a unidirectional data flow between them and the other layers in your architecture.
  2. Like in MVP, Interfaces in MVI represent Views, which are then implemented in one or more Activities or Fragments.
  3. Intent represents an intention or a desire to perform an action, either by the user or the app itself. For every action, a View receives an Intent. The Presenter observes the Intent, and Models translate it into a new state.

Dagger Hilt

Playground for learning how to use Hilt. A new way to incorporate Dagger dependency injection into an Android application.

Examples

Below is a list of examples.

Hilt Basics

  1. Preparing to use Hilt
  2. Field injecting a class with no dependencies. You own that class.
  3. Scopes and the "tier-like" system
  4. Dependencies that require dependencies (Concrete classes that you own)
  5. Some things can't be constructor-injected.
  6. Hilt Modules, Binds and Provides
  7. Multiple Bindings of the same type

Basic MVI Repository Pattern

  1. Retrieve data from Number Api with Retrofit
  2. Cache data with Room
  3. Display cached data in UI

Download APK

About

Model view intent example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published