简体   繁体   English

Dagger 2.10-ContributesAndroidInjector批注

[英]Dagger 2.10 - ContributesAndroidInjector annotation

I've just implemented dagger.android as per documentation . 我刚刚按照文档实现了dagger.android First incorrect thing written there is existence of HasActivityInjector that was easily replaced with HasDispatchingActivityInjector . 首先写的不正确的事情是存在HasActivityInjector ,它很容易被HasDispatchingActivityInjector替换。

Another thing mentioned there is usage of @ContributesAndroidInjector annotation that should simplify source creation a bit... But I cannot find such annotation neither via Android studio autocomplete nor in their JavaDoc and link in the documentation redirects me to 404 site. 提到的另一件事是@ContributesAndroidInjector注释的使用,应该可以稍微简化源代码的创建...但是我既无法通过Android studio自动完成功能也无法在其JavaDoc中找到此类注释,并且文档中的链接将我重定向到404站点。 How can i use the annotation? 如何使用注释? Or can I? 可以吗

Edit : I'm using 编辑 :我正在使用

compile "com.google.dagger:dagger:$rootProject.daggerVersion"
compile "com.google.dagger:dagger-android:$rootProject.daggerVersion"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
annotationProcessor "com.google.dagger:dagger-android-processor:$rootProject.daggerVersion"

where daggerVersion = '2.10' 其中daggerVersion = '2.10'

@ContributesAndroidInjector is in HEAD , added ten days ago . @ContributesAndroidInjector是HEAD ,加入十天前 It is not yet in a numbered release in Maven, but I'd imagine it will be shortly. 它尚未在Maven的编号版本中发布,但我想很快就会发布。 Until then, you can download or clone the repository directly from Github (click the green button). 在此之前,您可以直接从Github下载或克隆存储库(单击绿色按钮)。

Edit: @ContributesAndroidInjector was released in Maven under version 2.11-rc1. 编辑: @ContributesAndroidInjector在Maven中以2.11-rc1版本发布。 Also HasDispatchingActivityInjector interface is now called HasActivityInjector as per documentation 根据文档, HasDispatchingActivityInjector接口现在也称为HasActivityInjector

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM