package Ġcom . example . example . presenter . some 2 Ċ Ċ import Ġandroid . arch . lifecycle . ViewModel Provider Ċ import Ġandroid . arch . lifecycle . ViewModel Providers Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . support . v 4 . app . Fragment Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . example . example . databinding . Fragment Some 2 Binding Ċ import Ġcom . example . example . utils . di . Injectable Ċ import Ġkotlinx . android . synt hetic . main . fragment _ some .* Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠSome Fragment 2 : ĠFragment (), ĠSome Fragment 2 Contract . View , ĠInjectable Ġ{ ĊĠĠĠ Ġ/* ĠFIXME ĠMUST Ġadd Ġbelow Ġmethod Ġto ĠParent ĠActivity 's ĠModule Ġ*/ Ċ // ĠĠĠ Ġ@ Bind s Ġ@ Into Map Ġ@ ViewModel Key ( Some Presenter 2 ViewModel :: class ) Ġabstract Ġfun Ġbind Some Presenter 2 ViewModel ( viewModel : ĠSome Presenter 2 ViewModel ): ĠViewModel Ċ // ĠĠĠ Ġ@ Contribut es Android Injector Ġabstract Ġfun Ġcontribute Some Fragment 2 (): Some Fragment 2 ĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar ĠviewModel Factory : ĠViewModel Provider . Factory ĊĠĠĠ Ġprivate Ġval Ġpresenter : ĠSome Fragment 2 Presenter ViewModel Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠIf Ġshare ĠViewModel Ġwith Ġother Ġfragments Ġon Ġsame ĠActivity , Ġfix Ġ' this ' Ġ-> Ġ' activity !! ' ĊĠĠĠĠĠĠĠ ĠViewModel Providers . of ( this , ĠviewModel Factory ). get ( Some Fragment 2 Presenter ViewModel :: class . java ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding : ĠFragment Some 2 Binding ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠFragment Some 2 Binding . inflate ( in flater , Ġcontainer !! , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn Ġbinding . root ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĠĠĠĠĠĠĠ Ġbinding . input 0 Button . setOnClickListener Ġ{ Ġpresenter . load ( 0 , Ġ{ binding . data Ġ= Ġit . some Data Entity })} Ġ// Data Binding ĊĠĠĠĠĠĠĠ Ġinput _ 1 _ button . setOnClickListener Ġ{ Ġpresenter . load ( 1 , Ġ{ binding . data Ġ= Ġit . some Data Entity }) Ġ} Ġ// Kotlin ĠAndroid ĠExtensions ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġnew Instance (): ĠSome Fragment 2 Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġargs Ġ= ĠBundle () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġfragment Ġ= ĠSome Fragment 2 () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment . arguments Ġ= Ġargs ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġfragment ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }