WeatherForecast Test Application
-
download the SouceCode and then unzip the file
-
open with android studio
-
go to open File -> Open -> select source code root folder (MyWeatherForecastApp-master) and then waiting for library downloading and build the project.
- MVVM + Clean Architecture
- Modular Architecture
- Koin Dependency Injection
- Jetpack Room, Navigation Component, DataBinding, DataStore, Paging3
- Retrofit for Networking
- Airbnb Epoxy : for building complex screens in a RecyclerView
- Coil : Image Loading library
- Coroutines + Asynchronous Flow : for working asynchronous and handling long running task
- for reuse to support for 7-day forecast
- assume it need to call for another API to get the Data.
- first go to data module and add the API endpoint with request and response model
- and do implement for getting data from API in repository, dataSource
- in domain layer then create a Usecase class that call for getting data from the repository
- the presentation layer in HomeViewModel. the function "loadHomeUiData" is responsible to getting data from usecase and create a UI model to render.
- with seal class "HomeUiModel". it the place to decide the type of UI layout we want.
- getting data from 7-day forecast is handle in function "loadHomeUiData" with combine operation so we can merge data from another API and mapping the sequence of the UI here.
- in the "ResultToHomeUiModelMapper" is where to handle for sequence of layout we want to render in homeFragment
- in the "HomeUiController" is where to render the UI layout according with the xml layout and binding the data to show
- with the Epoxy library, we can now flexible to reuse and adjust the layout in UI and this is layout structure in the app.