package Ġcom . fa him . example _ employee _ app . view model Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . paging . Paged List Ċ import Ġcom . fa him . example _ employee _ app . model . Employee Ċ import Ġcom . fa him . example _ employee _ app . repository . Employee Repository Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠSearch ViewModel Ġ@ Inject Ġconstructor ( application : ĠApplication , private Ġval Ġrepository : ĠEmployee Repository ) Ġ: ĠBase ViewModel ( application ) Ġ{ ĊĊĠĠĠ Ġvar Ġsearched Employee List LD Ġ: ĠLive Data < Paged List < Employee >> ? Ġ= Ġnull ĊĊĠĠĠ Ġprivate Ġval Ġ_ navigate To Detail Activity ML D Ġ= ĠMutable LiveData < Int >() ĊĠĠĠ Ġval Ġnavigate To Detail Activity LD Ġ: ĠLive Data < Int > Ġ= Ġ_ navigate To Detail Activity ML D ĊĊĊĠĠĠ Ġfun Ġsearch ( name : String ){ ĊĠĠĠĠĠĠĠ Ġsearched Employee List LD Ġ= Ġrepository . get Se ar ched Employee List ( name ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Item Click ( id : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ navigate To Detail Activity ML D . value Ġ= Ġid ĊĠĠĠ Ġ} Ċ }