Created
June 29, 2019 17:48
-
-
Save jeremyrempel/d43956da90ee7c11affc835594e2183c 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 mainFragProvider: Provider<MainFragment> | |
) : FragmentFactory() { | |
override fun instantiate(classLoader: ClassLoader, className: String): Fragment { | |
return when (className) { | |
MainFragment::class.java.canonicalName -> mainFragProvider.get() | |
else -> TODO("Missing fragment $className") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment