Created
December 5, 2018 04:40
-
-
Save tompee26/50326fc9b23204883dfbc100f13bd0c4 to your computer and use it in GitHub Desktop.
MainActivityModule.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Module(includes = [MainActivityModule.FragmentBindings::class]) | |
class MainActivityModule { | |
@Module | |
interface FragmentBindings { | |
@ContributesAndroidInjector(modules = [MainFragmentModule::class]) | |
fun bindMainFragment() : MainFragment | |
} | |
@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