package Ġd roid developers 2 5 4 . dev fest n airo bi . view models Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroid . arch . lifecycle . Android ViewModel Ċ import Ġandroid . arch . lifecycle . LiveData Ċ import Ġandroid . arch . lifecycle . Mediator LiveData Ċ import Ġandroid . arch . lifecycle . ViewModel Ċ Ċ import Ġd roid developers 2 5 4 . dev fest n airo bi . models . Travel Info Model Ċ import Ġd roid developers 2 5 4 . dev fest n airo bi . repository . Travel Info Repo Ċ Ċ class ĠTr avel Info ViewModel ( application : ĠApplication ) Ġ: ĠAndroid ViewModel ( application ) Ġ{ ĊĠĠĠ Ġprivate Ġval Ġinfo ViewModel Mediator LiveData : ĠMed iator LiveData < Travel Info Model > Ġ= ĠMed iator LiveData () ĊĠĠĠ Ġprivate Ġval Ġtravel Info Repo : ĠTr avel Info Repo Ġ= ĠTr avel Info Repo ( application ) ĊĊĠĠĠ Ġval Ġtravel Info : ĠLive Data < Travel Info Model > ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġinfo ViewModel Mediator LiveData ĊĊĊĠĠĠ Ġfun Ġfetch Remote Config Values () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtravel Info Model LiveData Ġ= Ġtravel Info Repo . travel Info ĊĠĠĠĠĠĠĠ Ġinfo ViewModel Mediator LiveData . add Source ( travel Info Model LiveData ĊĠĠĠĠĠĠĠ Ġ) Ġ{ Ġinfo ViewModel Mediator LiveData Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( this . info ViewModel Mediator LiveData . has Active Observer s ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . info ViewModel Mediator LiveData . remove Source ( travel Info Model LiveData ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis . info ViewModel Mediator LiveData . setValue ( info ViewModel Mediator LiveData ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ