package Ġproject . rame z red a . movie z . ui . view models . factories Ċ Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġproject . rame z red a . movie z . data . repository . Repository Ċ import Ġproject . rame z red a . movie z . ui . view models . Main ViewModel Ċ Ċ class ĠMain ViewModel Factory ( private Ġval Ġrepository : ĠRepository ) Ġ: ĠViewModel Provider . Factory Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel ?> Ġcreate ( model Class : ĠClass < T >): ĠT Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠMain ViewModel ( repository ) Ġas ĠT ĊĠĠĠ Ġ} Ċ }