This repository contains a sample app that implements MVVM architecture using Kotlin, Dagger, Retrofit, Coroutines, Flow, StateFlow, etc.
- MVVM Architecture
- Kotlin
- Dagger2
- Retrofit
- Coroutines
- Flows
- Stateflow
- View binding
- Unit Test
- data: It contains all the data accessing and manipulating components.
- di: Dependency providing classes using Dagger2.
- ui: View classes along with their corresponding ViewModel.
- utils: Utility classes.
The main advantage of using MVVM, there is no two-way dependency between ViewModel and Model, unlike MVP. Here the view can observe the data changes in the ViewModel as we are using LiveData which is lifecycle aware. The viewmodel-to-view communication is achieved through observer pattern (basically observing the state changes of the data in the viewmodel).
- Fetching News
- Top Headlines News
- News Based on Source
- News Based on Single/Multi Country Selection
- News Based on Single/Multi Language Selection
- Instant Search using Flows Operator
- Debounce
- Filter
- DistinctUntilChanged
- FlatMapLatest
- Unit Test
- Mockito
- JUnit
- Turbine
Copyright (C) 2022
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.