Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private fun Fragment.getNavigationController(parent: Fragment? = null) : NavigationController? {
if (parentFragment == null) return null
if (parent == null) return getNavigationController(parentFragment)
if (parentFragment!! is NavigationController) {
return parentFragment as NavigationController
}
return getNavigationController(parentFragment)
}
val Fragment.navigationController : NavigationController? by lazy {
getNavigationController(parentFragment)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment