Updated on 2026-08-14

This commit is contained in:
Tangem 2020-12-11 13:14:58 +03:00
parent abccafead4
commit ea875f0112

View file

@ -18,11 +18,7 @@ import com.tangem.wallet.R
fun FragmentActivity.openFragment(screen: AppScreen, addToBackStack: Boolean = true) {
val transaction = this.supportFragmentManager.beginTransaction()
if (screen == AppScreen.Home) {
transaction.replace(R.id.fragment_container, fragmentFactory(screen), screen.name)
} else {
transaction.add(R.id.fragment_container, fragmentFactory(screen), screen.name)
}
transaction.replace(R.id.fragment_container, fragmentFactory(screen), screen.name)
if (addToBackStack && screen != AppScreen.Home) transaction.addToBackStack(null)
transaction.commitAllowingStateLoss()
}