package Ġapp . future d . ark ite kt . sample . ui . login . fragment Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġapp . future d . ark ite kt . sample . R Ċ import Ġapp . future d . ark ite kt . sample . databinding . Fragment Login Binding Ċ import Ġapp . future d . ark ite kt . sample . ui . base . Base Fragment Ċ import Ġjavax . inject . Inject Ċ import Ġapp . future d . ark ite kt . sample . ui . login . activity . Login ViewModel Ġas ĠA Login ViewModel Ċ Ċ class ĠLogin Fragment Ġ: ĠBase Fragment < Login ViewModel , ĠLogin ViewState , ĠFragment Login Binding >(), ĠLogin View Ġ{ ĊĊĠĠĠ Ġ@ Inject Ġoverride Ġlateinit Ġvar ĠviewModel Factory : ĠLogin ViewModel Factory ĊĊĠĠĠ Ġoverride Ġval Ġlayout Res Id Ġ= ĠR . layout . fragment _ login ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġobserve Event ( Notify Activity Event :: class ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠgetActivity ViewModel < AL og in ViewModel >(). send Toast Event ( it . message ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġobserve Event ( Navigate Back Event :: class ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrequire Activity (). on Back Pressed () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ