Created
February 15, 2021 13:42
-
-
Save abircse/ea9589ef55d8db4716f53f053385f16c to your computer and use it in GitHub Desktop.
FragmentControllerExtension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object BaseFragmentController { | |
fun load(fragment: Fragment, framelayout: Int, context: Context) { | |
val transaction = (context as FragmentActivity).supportFragmentManager.beginTransaction() | |
transaction.replace(framelayout, fragment, fragment::class.java.name) | |
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) | |
transaction.addToBackStack(null) | |
transaction.commit() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment