package Ġcom . small ur . feeds . presentation . views . post . details Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Build Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . support . annotation . Id Res Ċ import Ġandroid . support . v 4 . app . Fragment Ċ import Ġandroid . support . v 4 . app . FragmentManager Ċ import Ġcom . san jay . base library . databinding . Content Binding Ċ import Ġcom . small ur . feeds . R Ċ import Ġcom . small ur . feeds . data . model . Post Ċ import Ġcom . small ur . feeds . presentation . base . views . Activity D agger Base Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠSan jay Ċ Ġ* ĠActivity Ġfor Ġpost Ġdetails Ċ Ġ* Ġ*/ Ċ class ĠActivity Post Details Ġ: ĠActivity D agger Base < Content Binding >() Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠEX TR AS _ POST Ġ= Ġ" extras Post " ĊĠĠĠĠĠĠĠ Ġfun Ġnew Intent ( context : ĠContext ?, Ġpost : ĠPost ): ĠIntent Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġintent Ġ= ĠIntent ( context , ĠActivity Post Details :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġintent . putExtra ( Activity Post Details . EX TR AS _ POST , Ġpost ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġintent ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġvar Ġfragment Post Details : ĠFragment Post Details ? Ġ= Ġnull ĊĊĠĠĠ Ġoverride Ġfun Ġprovide Layout Res Id (): ĠInt Ġ= ĠR . layout . content ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġfragment Post Details Ġ= Ġsupport FragmentManager . find Fragment ById ( R . id . content ) Ġas ? ĠFragment Post Details ĊĠĠĠĠĠĠĠ Ġif Ġ( fragment Post Details Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġpost Ġ= Ġintent . get Parcelable Extra < Post >( EX TR AS _ POST ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment Post Details Ġ= ĠFragment Post Details . newInstance ( post ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd Fragment To Activity ( support FragmentManager , Ġfragment Post Details !! , ĠR . id . content , ĠFragment Post Details . TAG ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġoverride Ġfun Ġon Back Pressed () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Back Pressed () ĊĠĠĠĠĠĠĠ Ġif Ġ( Build . VERSION . SDK _ INT Ġ>= ĠBuild . VERSION _ CODES . LO L LI POP ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsupport Finish After Transition () Ġ// Ġfinish ing Ġactivity Ġafter Ġtransition ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }