package Ġcom . android . app _ a qi Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġcom . android . app _ a qi . model . A qi Model Ċ import Ġcom . android . app _ a qi . model . Site Model Ċ import Ġcom . android . app _ a qi . repository . A qi Repository Ċ import Ġcom . android . app _ a qi . repository . A qi Repository Impl Ċ Ċ class ĠShared ViewModel ( private Ġval Ġrepository Impl : ĠA qi Repository Ġ= ĠA qi Repository Impl ()) Ġ: ĠViewModel () Ġ{ ĊĠĠĠ Ġvar Ġcurrent Pos Ġ= Ġ 0 ĊĠĠĠ Ġlateinit Ġvar Ġall Site Ġ: List < Site Model > ĊĠĠĠ Ġlateinit Ġvar Ġfollowed Site Ġ: List < A qi Model > ĊĠĠĠ Ġfun Ġget Follow Site List () Ġ: ĠLive Data < List < Site Model >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrepository Impl . getAll Follow ed Site () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun ĠgetAll Site List () Ġ: ĠLive Data < List < Site Model >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrepository Impl . getAll Site List () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġfollow Site ( site Id : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġrepository Impl . follow Site ( site Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġun Follow Site ( site Id : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġrepository Impl . un Follow Site ( site Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun ĠgetLast 1 2 Hour A qi Data By Site Id ( site Id : ĠString ) Ġ: ĠLive Data < List < A qi Model >> { ĊĠĠĠĠĠĠĠ Ġreturn Ġrepository Impl . getLast 1 2 Hour A qi Data By Site Id ( site Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun ĠgetLast A qi Data By Site Id ( site IdList : ĠList < Site Model >) Ġ: ĠLive Data < List < A qi Model >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrepository Impl . getLast A qi Data By Site IdList ( site IdList ) ĊĠĠĠ Ġ} Ċ Ċ }