package Ġcom . ray w ender lich . w ew atch . view model Ċ Ċ import Ġandroid . util . Log Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġcom . ray w ender lich . w ew atch . data . Movie Repository Ċ import Ġcom . ray w ender lich . w ew atch . data . Movie Repository Impl Ċ import Ġcom . ray w ender lich . w ew atch . data . model . Movie Ċ Ċ class ĠSearch ViewModel Ġ( private Ġvar Ġrepository : ĠMovie Repository Ġ= ĠMovie Repository Impl ()): ViewModel (){ ĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . d ( Search ViewModel :: class . simple Name , Ġ" init : Ġ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġsearch Movie ( query : ĠString ): ĠLive Data < List < Movie > ?> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrepository . search Movies ( query ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġfun Ġsave Movie ( movie : ĠMovie ) Ġ{ ĊĠĠĠĠĠĠĠ Ġrepository . save Movie ( movie ) ĊĠĠĠ Ġ} Ċ }