Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@KaustubhPatange
Last active November 18, 2021 12:45
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/bb87edd741634507359fc4d08407ab05 to your computer and use it in GitHub Desktop.
Save KaustubhPatange/bb87edd741634507359fc4d08407ab05 to your computer and use it in GitHub Desktop.
// implement the interface in :home module
// this implementation is incorrect & will break, read further to know more.
class HomeInternalButtonClickedImpl @Inject constructor(
private val fragment: HomeFragment, // <-- We need HomeFragment since we need access to the childFragmentManager.
) : HomeInternalButtonClicked {
override fun goToNext() {
fragment.childFragmentManager.beginTransaction()
.addToBackStack("home-internal2")
.replace(R.id.frag_container, HomeInternal2Fragment::class.java, null)
.commit()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment