diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/AppModule.java b/app/src/main/java/com/wbrawner/simplemarkdown/AppModule.java deleted file mode 100644 index 6085a49..0000000 --- a/app/src/main/java/com/wbrawner/simplemarkdown/AppModule.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.wbrawner.simplemarkdown; - -import com.wbrawner.simplemarkdown.presentation.MarkdownPresenter; -import com.wbrawner.simplemarkdown.presentation.MarkdownPresenterImpl; -import com.wbrawner.simplemarkdown.utility.CrashlyticsErrorHandler; -import com.wbrawner.simplemarkdown.utility.ErrorHandler; - -import javax.inject.Singleton; - -import dagger.Module; -import dagger.Provides; - -/** - * Created by billy on 8/22/17. - */ - -@Module -public class AppModule { - @Provides @Singleton - public MarkdownPresenter provideMarkdownPresenter(ErrorHandler errorHandler) { - return new MarkdownPresenterImpl(errorHandler); - } - - @Provides - @Singleton - ErrorHandler provideErrorHandler() { - return new CrashlyticsErrorHandler(); - } -} \ No newline at end of file diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/AppModule.kt b/app/src/main/java/com/wbrawner/simplemarkdown/AppModule.kt new file mode 100644 index 0000000..58c73fa --- /dev/null +++ b/app/src/main/java/com/wbrawner/simplemarkdown/AppModule.kt @@ -0,0 +1,24 @@ +package com.wbrawner.simplemarkdown + +import com.wbrawner.simplemarkdown.presentation.MarkdownPresenter +import com.wbrawner.simplemarkdown.presentation.MarkdownPresenterImpl +import com.wbrawner.simplemarkdown.utility.CrashlyticsErrorHandler +import com.wbrawner.simplemarkdown.utility.ErrorHandler +import dagger.Module +import dagger.Provides +import javax.inject.Singleton + +@Module +class AppModule { + @Provides + @Singleton + fun provideMarkdownPresenter(errorHandler: ErrorHandler): MarkdownPresenter { + return MarkdownPresenterImpl(errorHandler) + } + + @Provides + @Singleton + internal fun provideErrorHandler(): ErrorHandler { + return CrashlyticsErrorHandler() + } +} \ No newline at end of file