package Ġmp . com . view models Ċ Ċ import Ġandroid . arch . lifecycle . LiveData Ċ import Ġandroid . arch . lifecycle . ViewModel Ċ import Ġmp . com . repositories . Movie Details Repository Ċ import Ġmp . com . request models . Movie Credit Request Ċ import Ġmp . com . request models . Movie Reviews Request ĊĊ Ċ /** Ċ Ġ* ĠCreated Ġby ĠK ash ish Ġon Ġ 1 5 - 0 8 - 2 0 1 8 . Ċ Ġ*/ Ċ class ĠMovie Details ViewModel ( private Ġval Ġdetails Repo : ĠMovie Details Repository ): ĠViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġmovie Detail : ĠLive Data < mp . com . models . Movie Detail >? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġvar Ġmovie Reviews : ĠLive Data < Movie Reviews Request >? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġvar Ġmovie Credit : ĠLive Data < Movie Credit Request >? Ġ= Ġnull ĊĊĠĠĠ Ġfun Ġget Details ( movie Id : ĠString ): ĠLive Data < mp . com . models . Movie Detail >{ ĊĠĠĠĠĠĠĠ Ġif Ġ( movie Detail Ġ== Ġnull ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmovie Detail Ġ= Ġdetails Repo . get Movie Details ( movie Id ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġmovie Detail !! ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Reviews ( movie Id : ĠLong ): ĠLive Data < Movie Reviews Request >{ ĊĠĠĠĠĠĠĠ Ġif Ġ( movie Reviews Ġ== Ġnull ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmovie Reviews Ġ= Ġdetails Repo . get Movie Reviews ( movie Id ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġmovie Reviews !! ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Credits ( movie Id : ĠLong ): ĠLive Data < Movie Credit Request >{ ĊĠĠĠĠĠĠĠ Ġif Ġ( movie Credit Ġ== Ġnull ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmovie Credit Ġ= Ġdetails Repo . get Movie Credit ( movie Id ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġmovie Credit !! ĊĠĠĠ Ġ} Ċ Ċ }