package Ġcom . lm ord a . shop per Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . lifecycle . Abstract Saved State ViewModel Factory Ċ import Ġandroidx . lifecycle . Saved State Handle Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . saved state . Saved State Registry Owner Ċ import Ġcom . lm ord a . shop per . buy again . Buy Again ViewModel Ċ import Ġcom . lm ord a . shop per . cart . Cart ViewModel Ċ import Ġcom . lm ord a . shop per . data . Shop per Repository Ċ import Ġcom . lm ord a . shop per . details . Details ViewModel Ċ import Ġcom . lm ord a . shop per . arrival . Arrival ViewModel Ċ import Ġcom . lm ord a . shop per . orders . Orders ViewModel Ċ import Ġcom . lm ord a . shop per . status . Status ViewModel Ċ import Ġcom . lm ord a . shop per . store . Store ViewModel Ċ Ċ @ Suppress (" UN CHECK ED _ CAST ") Ċ class ĠViewModel Factory Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġshop per Repository : ĠShop per Repository , ĊĠĠĠ Ġowner : ĠSaved State Registry Owner , ĊĠĠĠ Ġdefault Args : ĠBundle ? Ġ= Ġnull Ċ ) Ġ: ĠAbstract Saved State ViewModel Factory ( owner , Ġdefault Args ) Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel > Ġcreate ( ĊĠĠĠĠĠĠĠ Ġkey : ĠString , ĊĠĠĠĠĠĠĠ Ġmodel Class : ĠClass < T >, ĊĠĠĠĠĠĠĠ Ġhandle : ĠSaved State Handle ĊĠĠĠ Ġ) Ġ= Ġwith ( model Class ) Ġ{ ĊĠĠĠĠĠĠĠ Ġwhen Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis AssignableFrom ( Cart ViewModel :: class . java ) Ġ-> ĠCart ViewModel ( shop per Repository ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis AssignableFrom ( Details ViewModel :: class . java ) Ġ-> ĠDetails ViewModel ( shop per Repository , Ġhandle ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis AssignableFrom ( Status ViewModel :: class . java ) Ġ-> ĠStatus ViewModel ( shop per Repository ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis AssignableFrom ( Store ViewModel :: class . java ) Ġ-> ĠStore ViewModel ( shop per Repository ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis AssignableFrom ( Buy Again ViewModel :: class . java ) Ġ-> ĠBu y Again ViewModel ( shop per Repository ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis AssignableFrom ( Arrival ViewModel :: class . java ) Ġ-> ĠAr rival ViewModel ( shop per Repository , Ġhandle ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis AssignableFrom ( Orders ViewModel :: class . java ) Ġ-> ĠOrders ViewModel ( shop per Repository ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> Ġthrow ĠIllegalArgumentException (" Unknown ĠViewModel Ġclass : Ġ${ model Class . name }") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ġas ĠT Ċ }