Skip to content

Instantly share code, notes, and snippets.

@KaustubhPatange
Last active November 23, 2021 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaustubhPatange/4b8909c43d6a5d438e0513c717e6da3a to your computer and use it in GitHub Desktop.
Save KaustubhPatange/4b8909c43d6a5d438e0513c717e6da3a to your computer and use it in GitHub Desktop.
// in :home module
@Module
@InstallIn(FragmentComponent::class)
class HomeDependencyModule {
...
@Provides @HomeQualifier
fun homeFragment(fragment: Fragment) : HomeFragment {
return fragment.requireActivity().supportFragmentManager.fragments.find { it is HomeFragment } as HomeFragment
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment