package Ġcom . ieee vit . g ak ko . ui . class room . join class room Ċ Ċ import Ġandroid . util . Log Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġcom . ieee vit . g ak ko . data . repository . Class room Repository Ċ Ċ class ĠJoin Class room ViewModel Ġ( ĊĠĠĠ Ġprivate Ġval Ġclass room Repository : ĠClass room Repository Ċ ): ĠViewModel () Ġ{ ĊĠĠĠ Ġval Ġ_ user _ class room _ ids Ġ= ĠMutable LiveData < List < String >>() ĊĠĠĠ Ġval Ġusr Join Class room Response Ġ= ĠMutable LiveData < Boolean >() ĊĠĠĠ Ġval Ġclass Ex istence Response Ġ= ĠMutable LiveData < Boolean >() ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġclass room Repository . user Class room Ids . observe Fore ver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLog . d (" Join Class room ViewModel "," The ĠViewModel Ġrec ieved Ġ$ it ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ_ user _ class room _ ids . post Value ( it ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġclass room Repository . join Class room Response . observe Fore ver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġusr Join Class room Response . post Value ( it ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġclass room Repository . class room Ex istence Response . observe Fore ver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġclass Ex istence Response . post Value ( it ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġsuspend Ġfun Ġjoin Class ( class Code : ĠString ){ ĊĠĠĠĠĠĠĠ Ġclass room Repository . join Class room ( class Code ) ĊĠĠĠĠĠĠĠ ĠLog . d (" Join Class room ViewModel "," The Ġre e quest ed ĠClass code Ġis Ġ$ class Code ") ĊĠĠĠ Ġ} ĊĊĊ Ċ } Ċ