package Ġapps . ric as ares . com . my reddit . listing Ċ Ċ import Ġandroid . arch . lifecycle . ViewModel Ċ import Ġandroid . arch . lifecycle . ViewModel Provider Ċ import Ġapps . ric as ares . com . domain . inter actor . browse . Get Listing UseCase Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠList ings ViewModel Factory Ġ@ Inject Ġconstructor ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġlisting UseCase : ĠGet Listing UseCase ): ĠViewModel Provider . Factory Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel ?> Ġcreate ( model Class : ĠClass < T >): ĠT Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( model Class . isAssignableFrom ( List ings ViewModel :: class . java )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠList ings ViewModel ( listing UseCase ) Ġas ĠT ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġthrow ĠIllegalArgumentException (" Unknown ĠViewModel Ġclass ") ĊĠĠĠ Ġ} Ċ }