@ file : Suppress (" Red undant Visibility Modifier ", Ġ" unused ") Ċ @ file : Jvm Name (" Activity View Bindings ") Ċ Ċ package Ġby . kir ich 1 4 0 9 . view binding delegate Ċ Ċ import Ġandroid . view . View Ċ import Ġandroidx . activity . Component Activity Ċ import Ġandroidx . annotation . Id Res Ċ import Ġandroidx . annotation . Restrict To Ċ import Ġandroidx . annotation . Restrict To . Scope . LIBRARY Ċ import Ġandroidx . annotation . Restrict To . Scope . LIBRARY _ GROUP Ċ import Ġandroidx . lifecycle . Lifecycle Owner Ċ import Ġandroidx . view binding . View Binding Ċ import Ġby . kir ich 1 4 0 9 . view binding delegate . internal . empty Vb Callback Ċ import Ġby . kir ich 1 4 0 9 . view binding delegate . internal . find Root View Ċ import Ġby . kir ich 1 4 0 9 . view binding delegate . internal . require ViewById Compat Ċ Ċ @ Restrict To ( LIBRARY ) Ċ private Ġclass ĠActivity View Binding Property < in ĠA Ġ: ĠComponent Activity , Ġout ĠT Ġ: ĠView Binding >( ĊĠĠĠ Ġon View Destroyed : Ġ( T ) Ġ-> ĠUnit , ĊĠĠĠ Ġprivate Ġval Ġview Need Initialization : ĠBoolean Ġ= Ġtrue , ĊĠĠĠ Ġview Binder : Ġ( A ) Ġ-> ĠT Ċ ) Ġ: ĠLifecycle View Binding Property < A , ĠT >( view Binder , Ġon View Destroyed ) Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġget Lifecycle Owner ( this Ref : ĠA ): ĠLifecycle Owner Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġthis Ref ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġis View Initialized ( this Ref : ĠA ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġview Need Initialization Ġ&& Ġthis Ref . window Ġ!= Ġnull ĊĠĠĠ Ġ} Ċ } Ċ Ċ /** Ċ Ġ* ĠCreate Ġnew Ġ[ View Binding ] Ġassociated Ġwith Ġthe Ġ[ Activity ][ Component Activity ] Ġand Ġallow Ġcustomize Ġhow Ċ Ġ* Ġa Ġ[ View ] Ġwill Ġbe Ġbounded Ġto Ġthe Ġview Ġbinding . Ċ Ġ*/ Ċ @ Jvm Name (" view Binding Activity ") Ċ public Ġfun Ġ< A Ġ: ĠComponent Activity , ĠT Ġ: ĠView Binding > ĠComponent Activity . view Binding ( ĊĠĠĠ Ġview Binder : Ġ( A ) Ġ-> ĠT Ċ ): ĠView Binding Property < A , ĠT > Ġ{ ĊĠĠĠ Ġreturn Ġview Binding ( empty Vb Callback (), Ġview Binder ) Ċ } Ċ Ċ /** Ċ Ġ* ĠCreate Ġnew Ġ[ View Binding ] Ġassociated Ġwith Ġthe Ġ[ Activity ][ Component Activity ] Ġand Ġallow Ġcustomize Ġhow Ċ Ġ* Ġa Ġ[ View ] Ġwill Ġbe Ġbounded Ġto Ġthe Ġview Ġbinding . Ċ Ġ*/ Ċ @ Jvm Name (" view Binding Activity With Callbacks ") Ċ public Ġfun Ġ< A Ġ: ĠComponent Activity , ĠT Ġ: ĠView Binding > ĠComponent Activity . view Binding ( ĊĠĠĠ Ġon View Destroyed : Ġ( T ) Ġ-> ĠUnit Ġ= Ġ{}, ĊĠĠĠ Ġview Binder : Ġ( A ) Ġ-> ĠT Ċ ): ĠView Binding Property < A , ĠT > Ġ{ ĊĠĠĠ Ġreturn ĠActivity View Binding Property ( on View Destroyed , Ġview Binder Ġ= Ġview Binder ) Ċ } Ċ Ċ /** Ċ Ġ* ĠCreate Ġnew Ġ[ View Binding ] Ġassociated Ġwith Ġthe Ġ[ Activity ][ Component Activity ] Ġand Ġallow Ġcustomize Ġhow Ċ Ġ* Ġa Ġ[ View ] Ġwill Ġbe Ġbounded Ġto Ġthe Ġview Ġbinding . Ċ Ġ*/ Ċ @ Jvm Name (" view Binding Activity ") Ċ public Ġinline Ġfun Ġ< A Ġ: ĠComponent Activity , ĠT Ġ: ĠView Binding > ĠComponent Activity . view Binding ( ĊĠĠĠ Ġcross inline Ġvb Factory : Ġ( View ) Ġ-> ĠT , ĊĠĠĠ Ġcross inline Ġview Provider : Ġ( A ) Ġ-> ĠView Ġ= Ġ:: find Root View Ċ ): ĠView Binding Property < A , ĠT > Ġ{ ĊĠĠĠ Ġreturn Ġview Binding ( empty Vb Callback (), Ġvb Factory , Ġview Provider ) Ċ } Ċ Ċ /** Ċ Ġ* ĠCreate Ġnew Ġ[ View Binding ] Ġassociated Ġwith Ġthe Ġ[ Activity ][ Component Activity ] Ġand Ġallow Ġcustomize Ġhow Ċ Ġ* Ġa Ġ[ View ] Ġwill Ġbe Ġbounded Ġto Ġthe Ġview Ġbinding . Ċ Ġ*/ Ċ @ Jvm Name (" view Binding Activity With Callbacks ") Ċ public Ġinline Ġfun Ġ< A Ġ: ĠComponent Activity , ĠT Ġ: ĠView Binding > ĠComponent Activity . view Binding ( ĊĠĠĠ Ġno inline Ġon View Destroyed : Ġ( T ) Ġ-> ĠUnit Ġ= Ġ{}, ĊĠĠĠ Ġcross inline Ġvb Factory : Ġ( View ) Ġ-> ĠT , ĊĠĠĠ Ġcross inline Ġview Provider : Ġ( A ) Ġ-> ĠView Ġ= Ġ:: find Root View Ċ ): ĠView Binding Property < A , ĠT > Ġ{ ĊĠĠĠ Ġreturn Ġview Binding ( on View Destroyed ) Ġ{ Ġactivity Ġ-> Ġvb Factory ( view Provider ( activity )) Ġ} Ċ } Ċ Ċ /** Ċ Ġ* ĠCreate Ġnew Ġ[ View Binding ] Ġassociated Ġwith Ġthe Ġ[ Activity ][ this ] Ġand Ġallow Ġcustomize Ġhow Ċ Ġ* Ġa Ġ[ View ] Ġwill Ġbe Ġbounded Ġto Ġthe Ġview Ġbinding . Ċ Ġ* Ċ Ġ* Ġ@ param Ġvb Factory ĠFunction Ġthat Ġcreate Ġnew Ġinstance Ġof Ġ[ View Binding ]. Ġ` My View Binding :: bind ` Ġcan Ġbe Ġused Ċ Ġ* Ġ@ param Ġview Binding Root Id ĠRoot Ġview 's Ġid Ġthat Ġwill Ġbe Ġused Ġas Ġroot Ġfor Ġthe Ġview Ġbinding Ċ Ġ*/ Ċ @ Suppress (" unused ") Ċ @ Jvm Name (" view Binding Activity ") Ċ public Ġinline Ġfun Ġ< T Ġ: ĠView Binding > ĠComponent Activity . view Binding ( ĊĠĠĠ Ġcross inline Ġvb Factory : Ġ( View ) Ġ-> ĠT , ĊĠĠĠ Ġ@ Id Res Ġview Binding Root Id : ĠInt Ċ ): ĠView Binding Property < Component Activity , ĠT > Ġ{ ĊĠĠĠ Ġreturn Ġview Binding ( empty Vb Callback (), Ġvb Factory , Ġview Binding Root Id ) Ċ } Ċ Ċ /** Ċ Ġ* ĠCreate Ġnew Ġ[ View Binding ] Ġassociated Ġwith Ġthe Ġ[ Activity ][ this ] Ġand Ġallow Ġcustomize Ġhow Ċ Ġ* Ġa Ġ[ View ] Ġwill Ġbe Ġbounded Ġto Ġthe Ġview Ġbinding . Ċ Ġ* Ċ Ġ* Ġ@ param Ġvb Factory ĠFunction Ġthat Ġcreate Ġnew Ġinstance Ġof Ġ[ View Binding ]. Ġ` My View Binding :: bind ` Ġcan Ġbe Ġused Ċ Ġ* Ġ@ param Ġview Binding Root Id ĠRoot Ġview 's Ġid Ġthat Ġwill Ġbe Ġused Ġas Ġroot Ġfor Ġthe Ġview Ġbinding Ċ Ġ*/ Ċ @ Suppress (" unused ") Ċ @ Jvm Name (" view Binding Activity ") Ċ public Ġinline Ġfun Ġ< T Ġ: ĠView Binding > ĠComponent Activity . view Binding ( ĊĠĠĠ Ġno inline Ġon View Destroyed : Ġ( T ) Ġ-> ĠUnit Ġ= Ġ{}, ĊĠĠĠ Ġcross inline Ġvb Factory : Ġ( View ) Ġ-> ĠT , ĊĠĠĠ Ġ@ Id Res Ġview Binding Root Id : ĠInt Ċ ): ĠView Binding Property < Component Activity , ĠT > Ġ{ ĊĠĠĠ Ġreturn Ġview Binding ( on View Destroyed ) Ġ{ Ġactivity Ġ-> ĊĠĠĠĠĠĠĠ Ġvb Factory ( activity . require ViewById Compat ( view Binding Root Id )) ĊĠĠĠ Ġ} Ċ } Ċ Ċ @ Restrict To ( LIBRARY _ GROUP ) Ċ fun Ġ< A Ġ: ĠComponent Activity , ĠT Ġ: ĠView Binding > Ġ Ġactivity View Binding ( ĊĠĠĠ Ġon View Destroyed : Ġ( T ) Ġ-> ĠUnit , ĊĠĠĠ Ġview Need Initialization : ĠBoolean Ġ= Ġtrue , ĊĠĠĠ Ġview Binder : Ġ( A ) Ġ-> ĠT Ċ ): ĠView Binding Property < A , ĠT > Ġ{ ĊĠĠĠ Ġreturn ĠActivity View Binding Property ( on View Destroyed , Ġview Need Initialization , Ġview Binder ) Ċ } Ċ