/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 8 ĠSimon ĠV ig ĠTh erk ild sen Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġnet . sim on vt . c ath ode . ui . shows . up coming Ċ Ċ import Ġandroid . content . Context Ċ import Ġnet . sim on vt . c ath ode . actions . invoke Sync Ċ import Ġnet . sim on vt . c ath ode . actions . user . Sync W atched Shows Ċ import Ġnet . sim on vt . c ath ode . common . data . Mapped Cursor LiveData Ċ import Ġnet . sim on vt . c ath ode . entity . Show With Episode Ċ import Ġnet . sim on vt . c ath ode . entity mapper . Show With Episode List Mapper Ċ import Ġnet . sim on vt . c ath ode . entity mapper . Show With Episode Mapper Ċ import Ġnet . sim on vt . c ath ode . provider . Provider S che matic . Shows Ċ import Ġnet . sim on vt . c ath ode . settings . Up coming Time Preference Ċ import Ġnet . sim on vt . c ath ode . ui . Refresh able ViewModel Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠUp coming ViewModel Ġ@ Inject Ġconstructor ( ĊĠ Ġprivate Ġval Ġcontext : ĠContext , ĊĠ Ġprivate Ġval Ġupcoming Time Preference : ĠUp coming Time Preference , ĊĠ Ġprivate Ġval Ġupcoming Sort By Preference : ĠUp coming Sort By Preference , ĊĠ Ġprivate Ġval Ġsync W atched Shows : ĠSync W atched Shows Ċ ) Ġ: ĠRefresh able ViewModel () Ġ{ ĊĊĠ Ġval Ġshows : ĠM apped Cursor LiveData < List < Show With Episode >> Ġ= ĠM apped Cursor LiveData ( ĊĠĠĠ Ġcontext , ĊĠĠĠ ĠShows . SHO WS _ UP COM ING , ĊĠĠĠ ĠShow With Episode Mapper . projection , ĊĠĠĠ Ġnull , ĊĠĠĠ Ġnull , ĊĠĠĠ Ġupcoming Sort By Preference . get (). sort Order , ĊĠĠĠ ĠShow With Episode List Mapper ĊĠ Ġ) ĊĊĠ Ġprivate Ġval Ġupcoming Time ChangeListener Ġ= ĊĠĠĠ ĠUp coming Time Preference . Up coming Time ChangeListener Ġ{ Ġshows . load Data () Ġ} ĊĊĠ Ġprivate Ġval Ġupcoming Sort By Listener Ġ= ĊĠĠĠ ĠUp coming Sort By Preference . Up coming Sort By Listener Ġ{ ĠsortBy Ġ-> Ġshows . set SortOrder ( sortBy . sort Order ) Ġ} ĊĊĠ Ġinit Ġ{ ĊĠĠĠ Ġupcoming Time Preference . register Listener ( up coming Time ChangeListener ) ĊĠĠĠ Ġupcoming Sort By Preference . register Listener ( up coming Sort By Listener ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon Cle ared () Ġ{ ĊĠĠĠ Ġupcoming Time Preference . unregister Listener ( up coming Time ChangeListener ) ĊĠĠĠ Ġupcoming Sort By Preference . unregister Listener ( up coming Sort By Listener ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġsuspend Ġfun Ġon Refresh () Ġ{ ĊĠĠĠ Ġsync W atched Shows . invoke Sync ( Sync W atched Shows . Params ()) ĊĠ Ġ} Ċ } Ċ