Convert AppModule to Kotlin

This commit is contained in:
Billy Brawner 2019-08-17 13:50:41 -05:00 committed by William Brawner
parent 02069d8737
commit 50b494cef3
2 changed files with 24 additions and 29 deletions

View file

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

View file

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