package Ġcom . m re bol lob . le it ner box . domain . extension Ċ Ċ import Ġandroid . support . v 4 . app . Fragment Ċ import Ġandroid . support . v 4 . app . FragmentManager Ċ import Ġandroid . support . v 4 . app . Fragment Transaction Ċ import Ġandroid . support . v 7 . app . AppCompatActivity Ċ import Ġcom . m re bol lob . le it ner box . R Ċ Ċ /* ĊĠĠĠ ĠFrom Ġhttps :// medium . com / thought s - overflow / how - to - add - a - fragment - in - kotlin - way - 7 3 2 0 3 c 5 a 4 5 0 b Ċ Ġ*/ Ċ Ċ inline Ġfun ĠFragment Manager . in Transaction ( func : ĠFragment Transaction . () Ġ-> ĠFragment Transaction ) Ġ{ ĊĠĠĠ Ġbegin Transaction (). func (). commit () Ċ } Ċ Ċ inline Ġfun ĠFragment Manager . in Transaction With Animation ( func : ĠFragment Transaction . () Ġ-> ĠFragment Transaction ) Ġ{ ĊĠĠĠ Ġbegin Transaction (). set Custom Animations ( ĊĠĠĠĠĠĠĠ ĠR . anim ator . card _ flip _ right _ in , ĊĠĠĠĠĠĠĠ ĠR . anim ator . card _ flip _ right _ out , ĊĠĠĠĠĠĠĠ ĠR . anim ator . card _ flip _ left _ in , ĊĠĠĠĠĠĠĠ ĠR . anim ator . card _ flip _ left _ out ĊĠĠĠ Ġ). func (). commit () Ċ } Ċ Ċ fun ĠAppCompatActivity . add Fragment ( fragment : ĠFragment , Ġframe Id : ĠInt ) Ġ{ ĊĠĠĠ Ġsupport FragmentManager . in Transaction Ġ{ Ġadd ( frame Id , Ġfragment ) Ġ} Ċ } Ċ Ċ fun ĠAppCompatActivity . replace Fragment ( fragment : ĠFragment , Ġframe Id : ĠInt ) Ġ{ ĊĠĠĠ Ġsupport FragmentManager . in Transaction Ġ{ Ġreplace ( frame Id , Ġfragment ) Ġ} Ċ } Ċ Ċ fun ĠAppCompatActivity . replace Fragment With Animation ( fragment : ĠFragment , Ġframe Id : ĠInt ) Ġ{ ĊĠĠĠ Ġsupport FragmentManager . in Transaction With Animation Ġ{ Ġreplace ( frame Id , Ġfragment ) Ġ} Ċ }