Created
August 10, 2020 17:30
-
-
Save catalinghita8/89443babe6b2c39b4f808b30fbe0867e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class WeatherListFragment: Fragment() { | |
| fun onCreate() { | |
| val vm = DataViewModel(DependencyInjector.injectedRepoistory) | |
| } | |
| } | |
| class WeatherItemDetailsFragment: Fragment() { | |
| fun onCreate() { | |
| val vm = DataViewModel(DependencyInjector.injectedRepoistory) | |
| } | |
| } | |
| // Container of objects shared across the whole project | |
| class DependencyInjector { | |
| val injectedRepoistory = WeatherRepository(LocalDataClient(LocalDataBase()), | |
| InMemoryDataClient(MemoryCache()), | |
| RemoteDataClient(RetrofitCLient())) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment