package Ġcom . sm ass ive . star arch w ars . fil ms . view model Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroid . arch . lifecycle . Android ViewModel Ċ import Ġandroid . arch . lifecycle . LiveData Ċ import Ġcom . sm ass ive . star arch w ars . data . base . extensions . map Ċ import Ġcom . sm ass ive . star arch w ars . data . fil ms . model . Film Ċ import Ġcom . sm ass ive . star arch w ars . data . fil ms . model . Fil ms Ċ import Ġcom . sm ass ive . star arch w ars . data . fil ms . repository . Fil ms Repository Ċ import Ġcom . sm ass ive . star arch w ars . fil ms . model . Film Item Ċ Ċ class ĠFil ms ViewModel ( application : ĠApplication , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprivate Ġval Ġfil ms Repository : ĠFil ms Repository ) Ġ: ĠAndroid ViewModel ( application ) Ġ{ ĊĊĠ Ġfun Ġget Fil ms (): ĠLive Data < List < Film Item >> Ġ= Ġfil ms Repository . get Fil ms (). map Ġ{ Ġit . get Film Items () Ġ} ĊĊĠ Ġprivate Ġfun ĠFil ms . get Film Items (): ĠList < Film Item > Ġ{ ĊĠĠĠ Ġreturn Ġarray ListOf < Film Item >(). apply Ġ{ ĊĠĠĠĠĠ Ġfor Ġ( film Ġin Ġthis @ get Film Items . results ) Ġ{ ĊĠĠĠĠĠĠĠ Ġadd ( film . get Film Item ()) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun ĠFil m . get Film Item () Ġ= ĠFil m Item ( getApplication (), Ġposter , Ġtitle , Ġdirector ) Ċ }