diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/AppComponent.java b/app/src/main/java/com/wbrawner/simplemarkdown/AppComponent.java deleted file mode 100644 index 56892bb..0000000 --- a/app/src/main/java/com/wbrawner/simplemarkdown/AppComponent.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.wbrawner.simplemarkdown; - -import android.content.Context; - -import com.wbrawner.simplemarkdown.view.activity.MainActivity; -import com.wbrawner.simplemarkdown.view.activity.SplashActivity; -import com.wbrawner.simplemarkdown.view.fragment.EditFragment; -import com.wbrawner.simplemarkdown.view.fragment.PreviewFragment; - -import javax.inject.Singleton; - -import dagger.BindsInstance; -import dagger.Component; - -/** - * Created by billy on 8/22/17. - */ - -@Singleton -@Component(modules = { AppModule.class }) -public interface AppComponent { - void inject(MarkdownApplication application); - void inject(MainActivity activity); - void inject(SplashActivity activity); - void inject(EditFragment fragment); - void inject(PreviewFragment fragment); - - @Component.Builder - abstract class Builder { - @BindsInstance - abstract Builder context(Context context); - - abstract AppComponent build(); - } -} diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/AppComponent.kt b/app/src/main/java/com/wbrawner/simplemarkdown/AppComponent.kt new file mode 100644 index 0000000..c6e2c46 --- /dev/null +++ b/app/src/main/java/com/wbrawner/simplemarkdown/AppComponent.kt @@ -0,0 +1,28 @@ +package com.wbrawner.simplemarkdown + +import android.content.Context +import com.wbrawner.simplemarkdown.view.activity.MainActivity +import com.wbrawner.simplemarkdown.view.activity.SplashActivity +import com.wbrawner.simplemarkdown.view.fragment.EditFragment +import com.wbrawner.simplemarkdown.view.fragment.PreviewFragment +import dagger.BindsInstance +import dagger.Component +import javax.inject.Singleton + +@Singleton +@Component(modules = [AppModule::class]) +interface AppComponent { + fun inject(application: MarkdownApplication) + fun inject(activity: MainActivity) + fun inject(activity: SplashActivity) + fun inject(fragment: EditFragment) + fun inject(fragment: PreviewFragment) + + @Component.Builder + abstract class Builder { + @BindsInstance + internal abstract fun context(context: Context): Builder + + internal abstract fun build(): AppComponent + } +}