Я пытаюсь добавить Dagger 2 в один проект. Я создал 3 компонента
AppComponent (the primary one)
RetrofitComponent (Dependent component works fine)
ControllerComponent (Subcomponent, not injecting properly)
это мой AppComponent
@ApplicationScope
@Component(modules = [ApplicationModule::class, PrefModule::class])
interface AppComponent {
fun inject(instance: AppInstance)
fun getAppPref(): AppPreference
fun newControllerComponent(controllerModule: ControllerModule): ControllerComponent
}
это мой ControllerComponent
@UIScope
@Subcomponent(modules = [ControllerModule::class])
interface ControllerComponent {
fun injectActivity(activity: BaseActivity)
fun injectDialog(dialog: BaseDialog)
}
ControllerModule
@Module
class ControllerModule(activity: FragmentActivity) {
var mActivity: FragmentActivity
init {
mActivity = activity
}
@Provides
fun getContext(): Context {
return mActivity
}
@Provides
fun getActivity(): Activity {
return mActivity
}
@Provides
fun getFragmentManager(): FragmentManager {
return mActivity.supportFragmentManager
}
@Provides
fun getDialogManager(fragmentManager: FragmentManager): DialogsManager
{
return DialogsManager(fragmentManager)
}
@Provides
fun getDialogsFactory(): DialogsFactory {
return DialogsFactory()
}
}
Инъекция активности работает нормально, но когда я пытаюсь ввести Диалог, она никогда не впрыскивает
controller.injectDialog(singleDialog)
Весь мой код здесь Ссылка Github . Нужна помощь. Что я не делаю или делаю неправильно, что не могу ввести из подкомпонента.