This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
Refactor Code #5
Comments
Oh you mean like this? class ApplicationClazz : DaggerApplication() {
private val appComponent = DaggerAppComponent.builder()
.application(this)
.build()
override fun onCreate() {
super.onCreate()
if (!LeakCanary.isInAnalyzerProcess(this)) {
LeakCanary.install(this)
}
if(BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
}
appComponent.inject(this)
PreferenceComponent_PrefAppComponent.init(this)
}
override fun applicationInjector(): AndroidInjector<out DaggerApplication> {
return appComponent
}
} I think it looks better than before too. If you want to contribute any codes or change something, |
Let's discuss the approach that you have followed. I think we can make the code more robust and better. Add me on FB @kjain9878 |
Refactored with PR |
okay, Thanks!! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
GithubFollows/app/src/main/java/com/skydoves/githubfollows/ApplicationClazz.kt
Line 24 in 966f1a3
Here you are calling
and then you are returning
can't you just make a var for
DaggerAppComponent.builder().application(this).build()
and then just call inject on that above.The text was updated successfully, but these errors were encountered: