package Ġcom . re vol gen x . an ilib . ui . view model . media Ċ Ċ import Ġandroidx . lifecycle . Mediator LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġcom . re vol gen x . an ilib . data . field . media . Media Stats Field Ċ import Ġcom . re vol gen x . an ilib . data . model . user . stats . Media Stats Model Ċ import Ġcom . re vol gen x . an ilib . infrastructure . repository . util . Resource Ċ import Ġcom . re vol gen x . an ilib . infrastructure . service . media . Media Browse Service Ċ import Ġio . reactivex . dis pos ables . Composite Disposable Ċ Ċ class ĠMedia Stats ViewModel ( private Ġval Ġbrowse Service : ĠMedia Browse Service ) Ġ: ĠViewModel () Ġ{ ĊĠĠĠ Ġval Ġstats LiveData Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠMed iator LiveData < Resource < Media Stats Model >> (). also Ġ{ Ġlive Data Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlive Data . add Source ( browse Service . media Stats LiveData ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġlive Data . value Ġ= Ġit ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval Ġcomposite Disposable Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠComposite Disposable () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Stats ( field : ĠMedia Stats Field ) Ġ{ ĊĠĠĠĠĠĠĠ Ġstats LiveData . value Ġ= ĠResource . loading ( null ) ĊĠĠĠĠĠĠĠ Ġbrowse Service . get Media Stats ( field , Ġcomposite Disposable ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Cle ared () Ġ{ ĊĠĠĠĠĠĠĠ Ġcomposite Disposable . clear () ĊĠĠĠĠĠĠĠ Ġsuper . on Cle ared () ĊĠĠĠ Ġ} Ċ } Ċ