package Ġcom . zh u inden . simple stack tutorials . steps . step _ 7 . features . registration Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġcom . zh u inden . simple stack extensions . fragments . Key ed Fragment Ċ import Ġcom . zh u inden . simple stack extensions . fragments k tx . lookup Ċ import Ġcom . zh u inden . simple stack tutorials . R Ċ import Ġcom . zh u inden . simple stack tutorials . databinding . Step 7 Create Login Credentials Fragment Binding Ċ import Ġcom . zh u inden . simple stack tutorials . utils . onClick Ċ import Ġcom . zh u inden . simple stack tutorials . utils . on TextChanged Ċ Ċ class ĠCreate Login Credentials Fragment Ġ: ĠKey ed Fragment ( R . layout . step 7 _ create _ login _ credentials _ fragment ) Ġ{ ĊĠĠĠ Ġprivate Ġval ĠviewModel Ġby Ġlazy Ġ{ Ġlookup < Registration ViewModel >() Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġval Ġbinding Ġ= ĠStep 7 Create Login Credentials Fragment Binding . bind ( view ) ĊĊĠĠĠĠĠĠĠ Ġbinding . text Username . setText ( viewModel . username ) ĊĠĠĠĠĠĠĠ Ġbinding . text Password . setText ( viewModel . password ) ĊĊĠĠĠĠĠĠĠ Ġbinding . text Username . on TextChanged Ġ{ Ġusername Ġ-> ĠviewModel . on Username Changed ( username ) Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . text Password . on TextChanged Ġ{ Ġpassword Ġ-> ĠviewModel . on Password Changed ( password ) Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . button Register And Login . onClick Ġ{ ĠviewModel . on Register And Login Clicked () Ġ} ĊĠĠĠ Ġ} Ċ }