package Ġcom . se ign eur . ga uv ain . wow splash . data . repository Ċ Ċ import Ġcom . se ign eur . ga uv ain . wow splash . data . api .* Ċ import Ġcom . se ign eur . ga uv ain . wow splash . data . model . photo . Photo Ċ import Ġcom . se ign eur . ga uv ain . wow splash . data . model . photo . Photo Collection Ċ import Ġio . reactivex . Flow able Ċ import Ġio . reactivex . Single Ċ import Ġio . reactivex . android . schedul ers . Android Schedulers Ċ import Ġio . reactivex . schedul ers . Schedulers Ċ Ċ class ĠCollections Repository ( private Ġval Ġservice : ĠUn Splash Service ) Ġ Ġ{ ĊĊĠĠĠ Ġfun Ġget Collections ( page : ĠLong , Ġper Page : ĠInt ): ĠFlow able < List < Photo Collection >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġservice . collections ( page , Ġper Page ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( Android Schedulers . main Thread ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Feature d Collections ( page : ĠLong , Ġper Page : ĠInt ): ĠFlow able < List < Photo Collection >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġservice . featured Collections ( page , Ġper Page ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( Android Schedulers . main Thread ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun ĠgetUser Collections ( userName : String , Ġpage : ĠLong , Ġper Page : ĠInt ) Ġ: Flow able < List < Photo Collection >> { ĊĠĠĠĠĠĠĠ Ġreturn Ġservice . user Collections ( userName , Ġpage , Ġper Page ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( Android Schedulers . main Thread ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġregister Photo In Collection ( collection Id : ĠString , Ġphoto Id : ĠString ): ĠSingle < Photo > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġservice . add Photo To Collection ( collection Id , Ġphoto Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( Android Schedulers . main Thread ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġremove Photo From Collection ( collection Id : ĠString , Ġphoto Id : ĠString ): ĠSingle < Photo > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġservice . remove Photo From Collection ( collection Id , Ġphoto Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( Schedulers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( Android Schedulers . main Thread ()) ĊĠĠĠ Ġ} Ċ Ċ } Ċ