Updated on 2026-08-14
This commit is contained in:
parent
abccafead4
commit
ea875f0112
1 changed files with 1 additions and 5 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue