Convert AppComponent to Kotlin

This commit is contained in:
Billy Brawner 2019-08-17 13:50:22 -05:00
parent cd884cd24b
commit 1208037c17
2 changed files with 28 additions and 35 deletions

View file

@ -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();
}
}

View file

@ -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
}
}