Created
April 13, 2020 12:56
-
-
Save rmyhal/bb01a100933a6a3aa205362fff6b5207 to your computer and use it in GitHub Desktop.
This file contains 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 KoinFragmentFactory : FragmentFactory() { | |
override fun instantiate(classLoader: ClassLoader, className: String): Fragment { | |
val clazz = Class.forName(className).kotlin | |
val instance = getKoin().getOrNull<Fragment>(clazz) | |
return instance ?: super.instantiate(classLoader, className) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment