Created
July 30, 2019 15:42
-
-
Save lamvann/ca221d74abe68a964dba5a4b1f02b3de to your computer and use it in GitHub Desktop.
This file contains 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
@Component( | |
modules = [ | |
ApiModule::class, | |
ContractModule::class, | |
ActivityBindingModule::class, | |
AndroidSupportInjectionModule::class | |
] | |
) | |
@Singleton | |
interface AppComponent : AndroidInjector<PresentationApp> { | |
/* | |
* We will call this builder interface from our custom Application class. | |
* This will set our application object to the AppComponent. | |
* So inside the AppComponent the application instance is available. | |
* So this application instance can be accessed by our modules | |
* such as ApiModule when needed | |
* | |
* */ | |
/* | |
* This is our custom Application class | |
* */ | |
override fun inject(presentationApp: PresentationApp) | |
@Component.Builder | |
interface Builder { | |
@BindsInstance | |
fun application(application: Application): Builder | |
fun build(): AppComponent | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment