Skip to content

Instantly share code, notes, and snippets.

@mazzouzi
Created June 14, 2022 09:58
Show Gist options
  • Save mazzouzi/faab4a1884dae6fbf8df15e8b28cd7c3 to your computer and use it in GitHub Desktop.
Save mazzouzi/faab4a1884dae6fbf8df15e8b28cd7c3 to your computer and use it in GitHub Desktop.
abstract class BaseTwoPanelsLeakFragment(
private val side: Fragment,
private val main: Fragment
) : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
childFragmentManager.beginTransaction().apply {
replace(R.id.side_container, side)
replace(R.id.main_container, main)
}.commitNow()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment