Last active
January 16, 2020 15:15
-
-
Save Tagakov/168cdef4d4ee6be69a549eba7f5fa224 to your computer and use it in GitHub Desktop.
template for adding new controller to DI graph
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
typealias YourController = ListEditorController | |
//do not forget to rename component and module | |
//do not forget to add module to parent component | |
//do not forget to add HasControllerInjector to parent entity [Application, Activity, Controller] if not present | |
@Subcomponent(modules = [ComponentModule::class]) | |
interface RenameMeComponent : AndroidInjector<YourController> { | |
@Subcomponent.Builder | |
abstract class Builder : AndroidInjector.Builder<YourController>() | |
} | |
@Module(subcomponents = [RenameMeComponent::class]) | |
abstract class RenameMeModule { | |
@Binds | |
@IntoMap | |
@ControllerKey(YourController::class) | |
abstract fun bindInjector(builder: RenameMeComponent.Builder): AndroidInjector.Factory<out Controller> | |
} | |
private class ComponentModule { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment