/* ĠCopyright Ġ 2 0 2 0 . ĠExplo re Ġin ĠH MS . ĠAll Ġrights Ġreserved . Ċ Ġ* Ġ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 ĊĊ Ġ* Ġ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 Ġcom . h ms . reference app . h if ood . view model Ċ Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġcom . h ms . reference app . h if ood . model . Recipe Summary Ċ import Ġcom . h ms . reference app . h if ood . remote . model . Base Food Ċ import Ġcom . h ms . reference app . h if ood . repository . Base Food Repository Ċ import Ġcom . h ms . reference app . h if ood . repository . Cloud Db Zone Wrapper Ċ import Ġcom . h ms . reference app . h if ood . repository . Recipe Repository Ċ Ċ class ĠRecipe Finder ViewModel Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġvar Ġm Cloud Db Zone Wrapper : ĠCloud Db Zone Wrapper Ġ= ĠCloud Db Zone Wrapper () ĊĊĠĠĠ Ġprivate Ġvar Ġrecipe Repository : ĠRecipe Repository ĊĠĠĠ Ġprivate Ġvar Ġbase Food Repository : ĠBase Food Repository ĊĊĠĠĠ Ġvar Ġrecognized Food s Ġ= ĠMutable LiveData < Mutable List < Base Food >>() ĊĠĠĠ Ġvar Ġrecipe List : ĠMutable LiveData < Mutable List < Recipe Summary >> ĊĠĠĠ Ġvar Ġmatched Recipe Id : ĠMutable LiveData < String > ĊĠĠĠ Ġvar Ġmatched Recipes Ids List : ĠMutable LiveData < Mutable List < String >> ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġm Cloud Db Zone Wrapper . create ObjectType () ĊĠĠĠĠĠĠĠ Ġm Cloud Db Zone Wrapper . open Cloud DB Zone () ĊĠĠĠĠĠĠĠ Ġbase Food Repository Ġ= ĠBase Food Repository ( m Cloud Db Zone Wrapper . m Cloud DB Zone ) ĊĠĠĠĠĠĠĠ Ġrecipe Repository Ġ= ĠRecipe Repository ( m Cloud Db Zone Wrapper . m Cloud DB Zone ) ĊĊĠĠĠĠĠĠĠ Ġmatched Recipes Ids List Ġ= Ġbase Food Repository . matched Recipes Ids List ĊĠĠĠĠĠĠĠ Ġrecognized Food s Ġ= Ġbase Food Repository . recognized Base Food ĊĠĠĠĠĠĠĠ Ġrecipe List Ġ= Ġrecipe Repository . recipe Summary List ĊĠĠĠĠĠĠĠ Ġmatched Recipe Id Ġ= Ġbase Food Repository . matched Recipe Id ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcheck Food List ( items : ĠMutable List < String >) Ġ{ ĊĠĠĠĠĠĠĠ Ġbase Food Repository . get If Base Food ( items ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Matched Recipes Details ( matched Recipes Ids : ĠMutable List < String >) Ġ{ ĊĠĠĠĠĠĠĠ Ġrecipe Repository . get Matched Recipes Details ( matched Recipes Ids ) ĊĠĠĠ Ġ} Ċ }