package Ġcom . air bnb . mv rx . hello h ilt Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġcom . air bnb . mv rx . Mv Rx View Ċ import Ġcom . air bnb . mv rx . fragment ViewModel Ċ import Ġcom . air bnb . mv rx . hello h ilt . databinding . Hello H ilt Fragment Binding Ċ import Ġcom . air bnb . mv rx . with State Ċ import Ġdagger . h ilt . android . Android EntryPoint Ċ Ċ @ Android EntryPoint Ċ class ĠHello H ilt Fragment Ġ: ĠFragment ( R . layout . hello _ h ilt _ fragment ), ĠM v Rx View Ġ{ ĊĠĠĠ Ġval ĠviewModel 1 : ĠHello H ilt ViewModel Ġby Ġfragment ViewModel ( key Factory Ġ= Ġ{ Ġ" a " Ġ}) ĊĠĠĠ Ġval ĠviewModel 2 : ĠHello H ilt ViewModel Ġby Ġfragment ViewModel ( key Factory Ġ= Ġ{ Ġ" b " Ġ}) ĊĊĠĠĠ Ġprivate Ġvar Ġ_ binding : ĠHello H ilt Fragment Binding ? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġval Ġbinding Ġget () Ġ= Ġ_ binding Ġ?: Ġerror (" Binding Ġwas Ġnull !") ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ binding Ġ= ĠHello H ilt Fragment Binding . inflate ( in flater , Ġcontainer , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn Ġbinding . root ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Destroy View () Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ binding Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġsuper . on Destroy View () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinvalidate () Ġ= Ġwith State ( viewModel 1 , ĠviewModel 2 ) Ġ{ Ġstate 1 , Ġstate 2 Ġ-> ĊĠĠĠĠĠĠĠ Ġ@ Suppress (" Det ek t . Max Line Length ") ĊĠĠĠĠĠĠĠ Ġbinding . with . text Ġ= Ġ"@ M aver icks ViewModel Scoped : ĠVM 1 : Ġ[ ${ state 1 . viewModel Scoped Class Id 1 }, ${ state 1 . viewModel Scoped Class Id 2 }] ĠVM 2 : Ġ[ ${ state 2 . viewModel Scoped Class Id 1 }, ${ state 2 . viewModel Scoped Class Id 2 }] " ĊĠĠĠĠĠĠĠ Ġ@ Suppress (" Det ek t . Max Line Length ") ĊĠĠĠĠĠĠĠ Ġbinding . without . text Ġ= Ġ" VM 1 : Ġ[ ${ state 1 . not ViewModel Scoped Class Id 1 }, ${ state 1 . not ViewModel Scoped Class Id 2 }] ĠVM 2 : Ġ[ ${ state 2 . not ViewModel Scoped Class Id 1 }, ${ state 2 . not ViewModel Scoped Class Id 2 }] " ĊĠĠĠ Ġ} Ċ } Ċ