package Ġco . ghost notes . sample . d agger 2 . ui . main Ċ Ċ import Ġandroid . arch . lifecycle . ViewModel Providers Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġco . ghost notes . sample . d agger 2 . R Ċ import Ġco . ghost notes . sample . d agger 2 . di . Activity Scoped Ċ import Ġco . ghost notes . sample . d agger 2 . util . Message Helper Ċ import Ġdagger . android . support . D agger Fragment Ċ import Ġkotlinx . android . synt hetic . main . main _ fragment .* Ċ import Ġjavax . inject . Inject Ċ Ċ @ Activity Scoped Ċ class ĠMain Fragment Ġ@ Inject Ġconstructor () Ġ: ĠD agger Fragment (), ĠMain Contract . View Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġmessage Helper : ĠMessage Helper ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar ĠviewModel : ĠMain ViewModel ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ?): ĠView Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . main _ fragment , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġlifecycle . add Observer ( Main Lifecycle Observer ( this , Ġmessage Helper )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Activity Created ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Activity Created ( savedInstanceState ) ĊĊĠĠĠĠĠĠĠ ĠviewModel Ġ= ĠViewModel Providers . of ( this ). get ( Main ViewModel :: class . java ) ĊĠĠĠĠĠĠĠ Ġ// ĠTODO : ĠUse Ġthe ĠViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Text ( text : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġmessage _ text . text Ġ= Ġtext ĊĠĠĠ Ġ} Ċ Ċ } Ċ