This is a basic project that showcases the use of MVI (Model View Intent) Architecture on Android.
It uses the MovieDB API to retrieve a list of popular movies and the detail of a selected movie.
To run this you need to register on the site and get an API Token, you will add this on the keys.properties file under the app/ folder
Below is a diagram that shows the flow of information on the application.
The classes at the top are the classes used in the flow and the bold ones to the right are the entities used in the flow
The flow of information is as follows:
- The
GridFragmentclass will dispatch aGridEventobject when an action is triggered on the UI - The
GridViewmodelwill observe this event using LiveData and will respond to any changes - When there's a change to the
GridEventLiveData, depending on the event the ViewModel will dispatch an action to theGridRepositoryto request a resource - The
GridRepositorywill then return the specified resource as aDataStateobject - The ViewModel will relay back this resource to the GridFragment via a
DataStateobservable - The
GridFragmentwill observe the DataState and react to it, depending on the available resource on the DataState object, the Grid Fragment will dispatch said resource to the ViewModel - The ViewModel will react to it via a
ViewStateobservable, when any resource is updated the ViewModel will relay back this update to the Grid Fragment via the ViewState observable - The
GridFragmentwill observe the ViewState and react to it, depending on the available resource it will update the UI Accordingly
