package Ġcom . example . ch 8 n . search . factories Ċ Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġcom . example . ch 8 n . data . repository . Movie Repository Native Ċ import Ġcom . example . ch 8 n . search . Movie Search ViewModel Ċ Ċ class ĠMovie Search ViewModel Factory Ġconstructor ( private Ġval Ġmovie Repository : ĠMovie Repository Native ) Ġ: ĠViewModel Provider . New Instance Factory (){ ĊĊĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel ?> Ġcreate ( model Class : ĠClass < T >): ĠT Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠMovie Search ViewModel ( movie Repository ) Ġas ĠT ĊĠĠĠ Ġ} Ċ Ċ }