package Ġjp . zu ik ou . system . reddit project sample 1 . presentation . repository Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Transform ations Ċ import Ġandroidx . paging . Live Paged List Builder Ċ import Ġandroidx . paging . Paged List Ċ import Ġio . reactivex . dis pos ables . Composite Disposable Ċ import Ġjp . zu ik ou . system . reddit project sample 1 . domain . model . R Sub Sub cri bers Entity Ċ import Ġjp . zu ik ou . system . reddit project sample 1 . presentation . data . datasource . Network State Ċ import Ġjp . zu ik ou . system . reddit project sample 1 . presentation . data . datasource . Sub Red d its DataSource Factory Ċ import Ġkotlin . properties . Deleg ates Ċ Ċ class ĠSub cri bers Repository Present Impl ( val Ġfactory : ĠSub Red d its DataSource Factory ): ĠPagination Repository < R Sub Sub cri bers Entity > Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġsub redd its : ĠLive Data < Paged List < R Sub Sub cri bers Entity >> Ġby ĠDeleg ates . notNull () ĊĊĠĠĠ Ġprivate Ġfun Ġget Paged List Config () Ġ= ĊĠĠĠĠĠĠĠ ĠP aged List . Config . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set PageSize ( 1 5 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Enable Place holders ( false ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġsub redd its Ġ= ĠLive Paged List Builder ( factory , Ġget Paged List Config ()). build () ĊĠĠĠ Ġ} ĊĠĠĠ Ġoverride Ġfun ĠgetList (): ĠLive Data < Paged List < R Sub Sub cri bers Entity >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsub redd its ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Network State (): ĠLive Data < Network State > Ġ= ĊĠĠĠĠĠĠĠ ĠTransform ations . switch Map ( factory . dataSource ) Ġ{ Ġit . network State Ġ} ĊĊĊĠĠĠ Ġoverride Ġfun Ġretry () Ġ{ ĊĠĠĠĠĠĠĠ Ġfactory . dataSource . value ?. retry () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġrefresh () Ġ{ ĊĠĠĠĠĠĠĠ Ġfactory . dataSource . value ?. invalidate () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Composite Disposable ( dis posable : ĠComposite Disposable ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfactory . composite Disposable Ġ= Ġdis posable ĊĠĠĠ Ġ} Ċ }