我是 dagger 和 kotlin 语言的新手,我想将下面的 java 代码翻译成 kotlin 代码。这是用 Java 编写的 Dagger 组件。
@Singleton
@Component(modules = {ApplicationModule.class, NetworkingModule.class})
public interface ApplicationComponent {
public PresentationComponent newPresentationComponent(PresentationModule presentationModule);
}
最佳答案
可能是这样的,
@Singleton
@Component(modules = [ApplicationModule::class, NetworkingModule::class])
interface ApplicationComponent {
fun newPresentationComponent(PresentationModule presentationModule): PresentationComponent
}
关于java - 如何用Kotlin编写Dagger组件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53887296/