Skip to content

Instantly share code, notes, and snippets.

@Rasalexman
Created June 24, 2019 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rasalexman/f2350fba15a84d5af69d11fa58665ac2 to your computer and use it in GitHub Desktop.
Save Rasalexman/f2350fba15a84d5af69d11fa58665ac2 to your computer and use it in GitHub Desktop.
class MainApplication : Application(), KodeinAware {
override val kodein: Kodein by Kodein.lazy {
bind<ViewModelFactory>() with singleton { ViewModelFactory(applicationContext) }
bind<MoviesDatabase>() with singleton {
Room.databaseBuilder(
applicationContext,
MoviesDatabase::class.java, "moviesDB"
).build()
}
import(androidXModule(this@MainApplication)) // for android components
import(netModule)
import(databaseModule)
import(localDataSourceModule)
import(remoteDataSourceModule)
import(repositoryModule)
import(useCasesModule)
import(viewModelsModule)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment