package Ġcom . ale k sk uz min . fly hi . core . view Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . databinding . Data Binding Util Ċ import Ġandroidx . databinding . ViewData Binding Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġcom . ale k sk uz min . fly hi . core . utils . Auto Cle ared Value Ċ import Ġcom . ale k sk uz min . fly hi . core . view model . Fly Hi ViewModel Ċ Ċ abstract Ġclass ĠData Binding Fragment < VIEW MODEL Ġ: ĠFly Hi ViewModel , ĠVIEW BINDING Ġ: ĠView Data Binding > Ġ: ĊĠĠĠ ĠFragment () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding : ĠAuto Cle ared Value < VIEW BINDING > ĊĊĠĠĠ Ġprotected Ġabstract Ġval Ġlayout Resource : ĠInt ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdata Binding : ĠVIEW BINDING Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠData Binding Util . inflate ( in flater , Ġlayout Resource , Ġcontainer , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġdata Binding . lifecycle Owner Ġ= Ġthis ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠAuto Cle ared Value ( this , Ġdata Binding ) ĊĠĠĠĠĠĠĠ Ġreturn Ġdata Binding . root ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġval ĠviewModel Ġ= Ġget ViewModel () ĊĊĠĠĠĠĠĠĠ Ġval Ġbinding Ġ= Ġbinding . get () Ġ?: Ġthrow ĠIllegalStateException (" Binding Ġwas Ġreleased ") ĊĠĠĠĠĠĠĠ Ġbind ViewModel ( binding , ĠviewModel ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġabstract Ġfun Ġbind ViewModel ( view Binding : ĠVIEW BINDING , ĠviewModel : ĠVIEW MODEL ) ĊĊĠĠĠ Ġabstract Ġfun Ġget ViewModel (): ĠVIEW MODEL ĊĊĠĠĠ Ġprotected Ġfun Ġget View Binding (): ĠVIEW BINDING Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= Ġview Ġ?: Ġthrow ĠIllegalStateException (" Fragment Ġwas Ġreleased ") ĊĠĠĠĠĠĠĠ Ġreturn ĠData Binding Util . get Binding ( view ) Ġ?: Ġthrow ĠIllegalStateException (" No Ġbinding ") ĊĠĠĠ Ġ} Ċ Ċ }