All right, so far we have created the news app with no particular architecture, but only separating
the remote data logic from the composable interfaces.
Now we want to clean up the app a little more using the AMP VM architecture, using code routines for
asynchronous tasks and operations, as well as adding a data processor, state or multiple ones, like
when it's loading or when an error occurs.
So in the project now we have the news manager class as the intermediary between the composable UI and
the service class.
The data flows from the new service class to the new manager and then the respective user interfaces.
We are using the retrofit call interface for asynchronous operations and mutable state of in order to
hold observable data.
So let's look at how this will change with the VM architecture.
For the movie architecture, instead of the news manager class sending data to the UI, it sends it
to the repository class, which then passes it to the main view model, where each UI will connect to
and observe the data states from there.
So every place in the UI where we have the news manager will be replaced with the main view model.
The VM and NVMe, which is the View model, is a special class created to solve particular problems
when using code routines.
Just like we will be doing with a view model subclass, we can launch a scope using view model scope
that is tied to the View model and is automatically cleared after using to avoid a memory leak.
Another advantage is during the screen configuring changes.
Data is usually recreated.
But with the view model, the state will be retained and the data remains the same.
So we will be modifying the app to show a progress bar when the data is loading a text element when
there is an error.
And if the request is successful, the data is going to be displayed.
We will learn more about this in the coming lectures.
So let's get started.