- The first screen listing the total amount of data per year in a recyclerView.
- When an entry in the first screen is clicked (or selected), a second screen (another fragment), listing amount of data in each quarter for the selected year.
- You should be able to swipe left and right to see quarter data for the next or previous year.
- When the internet is turned off, app still display the previous data.
- A class to handle the receipt of which year the user is currently viewing.
- local - Contains local database implementations
- network - Contains api implementations,, Resource - for response creations
Contains AppModule class for DI
Contains Constants, Event - for data events
Contains repository implementation for data access
DataStoreListViewModel - viewmodel connected to First Fragment, YearDetailsViewModel- viewmodel connected to second fragment
Contains fragments - to display UI, DataStoreListAdapter - adapter for displaying list items
Allows you to see the data consumption yearly. Each result from api is kept in the database in records_data table where the list of year data quarterly stored. Each time an api is called, the same RecordsData record in the Database is updated with the new list of repository ids.
Allows you to see listing amount of data in each quarter for the selected year. Allows you to swipe left and right to see quarter data for the next or previous year Each result from api is kept in the database in records_data table where the list of year data quarterly stored. Each time an api is called, the same RecordsData record in the Database is updated with the new list of repository ids.
The project uses local unit tests that run on your computer. To run and generate a coverage report, you can run:
./gradlew fullCoverageReport
ViewModel Tests Each ViewModel is tested using local unit tests with mock Repository implementations.
Each Repository is tested using local unit tests with mock web service and mock database.
The project uses MockWebServer project to test REST api interactions.
Although there can be more code coverage for Adaptors & Fragment tests but due to time crunch didnt added it.
Android Support Library Android Architecture Components MVVM Android Data Binding Dagger 2 for dependency injection Retrofit for REST api communication RoomDB mockito for mocking in tests