Skip to content

Instantly share code, notes, and snippets.

@tompee26
Created December 5, 2018 04:09
Show Gist options
  • Save tompee26/c6d0d07859f9e97674d20103433e07dd to your computer and use it in GitHub Desktop.
Save tompee26/c6d0d07859f9e97674d20103433e07dd to your computer and use it in GitHub Desktop.
ActivityModule.kt
@Module
class MainActivityModule {
@Provides
@MainActivityScope
fun provideWarrior(): Warrior = Warrior("Hercules", "Sword")
@Provides
@MainActivityScope
fun provideActivity(mainActivity: MainActivity) : MainActivity = mainActivity
@Provides
@MainActivityScope
fun provideFragmentManager(mainActivity: MainActivity) : FragmentManager = mainActivity.supportFragmentManager
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment