Created
December 4, 2019 19:26
-
-
Save mym0404/02d529e6c563a878b436f37d251d25f0 to your computer and use it in GitHub Desktop.
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
| class MyFragmentFactory @Inject constructor(private val myDependency: Dependency) : FragmentFactory() { | |
| override fun instantiate(classLoader: ClassLoader, className: String): Fragment { | |
| return when(loadFragmentClass(classLoader,className)) { | |
| MainFragment::class.java -> MainFragment(myDependency) | |
| else -> super.instantiate(classLoader, className) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment