/* Ċ Ġ* ĠCopyright Ġ 2 0 1 8 ĠB ak um on . Ġhttps :// github . com / B ak um on Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġ Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġme . bak um on . money keeper . view model Ċ Ċ import Ġandroid . arch . lifecycle . ViewModel Ċ import Ġandroid . arch . lifecycle . ViewModel Provider Ċ import Ġme . bak um on . money keeper . datasource . App DataSource Ċ import Ġme . bak um on . money keeper . ui . add . Add Record ViewModel Ċ import Ġme . bak um on . money keeper . ui . add . Option ViewModel Ċ import Ġme . bak um on . money keeper . ui . add . Record Type ViewModel Ċ import Ġme . bak um on . money keeper . ui . add . Transfer Assets ViewModel Ċ import Ġme . bak um on . money keeper . ui . add type . Add Type ViewModel Ċ import Ġme . bak um on . money keeper . ui . assets . Assets ViewModel Ċ import Ġme . bak um on . money keeper . ui . assets . add . Add Assets ViewModel Ċ import Ġme . bak um on . money keeper . ui . assets . detail . Assets Detail ViewModel Ċ import Ġme . bak um on . money keeper . ui . assets . detail . Modify List ViewModel Ċ import Ġme . bak um on . money keeper . ui . assets . detail . Order List ViewModel Ċ import Ġme . bak um on . money keeper . ui . assets . detail . Transfer Record ViewModel Ċ import Ġme . bak um on . money keeper . ui . assets . transfer . Transfer ViewModel Ċ import Ġme . bak um on . money keeper . ui . home . Home ViewModel Ċ import Ġme . bak um on . money keeper . ui . review . Review ViewModel Ċ import Ġme . bak um on . money keeper . ui . setting . Setting ViewModel Ċ import Ġme . bak um on . money keeper . ui . setting . backup . Backup ViewModel Ċ import Ġme . bak um on . money keeper . ui . setting . other . Other Setting ViewModel Ċ import Ġme . bak um on . money keeper . ui . statistics . bill . Bill ViewModel Ċ import Ġme . bak um on . money keeper . ui . statistics . reports . Reports ViewModel Ċ import Ġme . bak um on . money keeper . ui . type manage . Type Manage ViewModel Ċ import Ġme . bak um on . money keeper . ui . ty per ec ords . Type Records ViewModel Ċ import Ġme . bak um on . money keeper . ui . types ort . Type Sort ViewModel ĊĊ Ċ /** Ċ Ġ* ĠViewModel Ġ å·¥ åİĤ Ċ Ġ* Ċ Ġ* Ġ@ author ĠB ak um on Ġhttps :// bak um on . me Ċ Ġ*/ Ċ @ Suppress (" UN CHECK ED _ CAST ") Ċ class ĠViewModel Factory ( private Ġval Ġm DataSource : ĠApp DataSource ) Ġ: ĠViewModel Provider . Factory Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel > Ġcreate ( model Class : ĠClass < T >): ĠT Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwhen Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Add Record ViewModel :: class . java ) Ġ-> ĠAdd Record ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Record Type ViewModel :: class . java ) Ġ-> ĠRecord Type ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Transfer Assets ViewModel :: class . java ) Ġ-> ĠTransfer Assets ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Option ViewModel :: class . java ) Ġ-> ĠOption ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Home ViewModel :: class . java ) Ġ-> ĠHome ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Type Manage ViewModel :: class . java ) Ġ-> ĠType Manage ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Type Sort ViewModel :: class . java ) Ġ-> ĠType Sort ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Add Type ViewModel :: class . java ) Ġ-> ĠAdd Type ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Bill ViewModel :: class . java ) Ġ-> ĠBill ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Reports ViewModel :: class . java ) Ġ-> ĠReports ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Type Records ViewModel :: class . java ) Ġ-> ĠType Records ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Review ViewModel :: class . java ) Ġ-> ĠReview ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Setting ViewModel :: class . java ) Ġ-> ĠSetting ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Other Setting ViewModel :: class . java ) Ġ-> ĠOther Setting ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Backup ViewModel :: class . java ) Ġ-> ĠBackup ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Assets ViewModel :: class . java ) Ġ-> ĠAssets ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Add Assets ViewModel :: class . java ) Ġ-> ĠAdd Assets ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Assets Detail ViewModel :: class . java ) Ġ-> ĠAssets Detail ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Transfer ViewModel :: class . java ) Ġ-> ĠTransfer ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Modify List ViewModel :: class . java ) Ġ-> ĠModify List ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Transfer Record ViewModel :: class . java ) Ġ-> ĠTransfer Record ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmodel Class . isAssignableFrom ( Order List ViewModel :: class . java ) Ġ-> ĠOrder List ViewModel ( m DataSource ) Ġas ĠT ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> Ġthrow ĠIllegalArgumentException (" Unknown ĠViewModel Ġclass ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ