Skip to content

Instantly share code, notes, and snippets.

View dmytroKarataiev's full-sized avatar

Dmytro Karataiev dmytroKarataiev

View GitHub Profile
@dmytroKarataiev
dmytroKarataiev / Dagger2SimpleExample.kt
Last active May 20, 2020 00:16 — forked from vestrel00/Dagger2SimpleExample.java
Dagger Android 2.26 simple example with support for Singleton, PerActivity, PerFragment, and PerChildFragment scopes in Kotlin
// This is a super simplified example of how to use the dagger.android framework
// This example also shows how to scope subcomponents to higher level subcomponents:
// Activity -> Fragment -> Fragment
// It allows you to create a single instances of classes for an Activity and its Fragments.
// This example works with Dagger 2.26.
// App.kt
class App: Application(), HasAndroidInjector {
@Inject