Created
August 10, 2020 17:30
-
-
Save catalinghita8/e202dd754843273a9dc66fd53fe95763 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.injectedRepository) | |
| } | |
| } | |
| class WeatherItemDetailsFragment: Fragment() { | |
| fun onCreate() { | |
| val vm = DataViewModel(DependencyInjector.injectedRepository) | |
| } | |
| } | |
| // Container of objects shared across the whole project | |
| class DependencyInjector { | |
| val injectedRepository = 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