// ĠCopyright Ġ( c ) ĠMicrosoft ĠCorporation . ĠAll Ġrights Ġreserved . Ċ // ĠLicensed Ġunder Ġthe ĠMIT ĠLicense . Ċ Ċ package Ġcom . azure . android . communication . ui . calling . presentation . fragment . calling Ċ Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . Base ViewModel Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . calling . banner . Banner ViewModel Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . calling . control bar . Control Bar ViewModel Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . calling . hang up . Leave Confirm ViewModel Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . calling . header . Info Header ViewModel Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . calling . lob by . Lobby Overlay ViewModel Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . calling . local user . Local Participant ViewModel Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . calling . participant . grid . Participant Grid ViewModel Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . calling . participant list . Participant List ViewModel Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . common . aud i ode vic elist . Audio Device List ViewModel Ċ import Ġcom . azure . android . communication . ui . calling . presentation . fragment . factories . Calling ViewModel Factory Ċ import Ġcom . azure . android . communication . ui . calling . redux . Store Ċ import Ġcom . azure . android . communication . ui . calling . redux . state . Calling Status Ċ import Ġcom . azure . android . communication . ui . calling . redux . state . Lifecycle Status Ċ import Ġcom . azure . android . communication . ui . calling . redux . state . Redux State Ċ import Ġkotlinx . coroutines . Coroutine Scope Ċ Ċ internal Ġclass ĠCalling ViewModel ( ĊĠĠĠ Ġstore : ĠStore < Redux State >, ĊĠĠĠ Ġcalling ViewModel Provider : ĠCalling ViewModel Factory , Ċ ) Ġ: ĊĠĠĠ ĠBase ViewModel ( store ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġparticipant Grid ViewModel Ġ= ĊĠĠĠĠĠĠĠ Ġcalling ViewModel Provider . provide Participant Grid ViewModel () ĊĠĠĠ Ġprivate Ġval Ġcontrol Bar ViewModel Ġ= Ġcalling ViewModel Provider . provide Control Bar ViewModel () ĊĠĠĠ Ġprivate Ġval Ġconfirm Leave Overlay ViewModel Ġ= ĊĠĠĠĠĠĠĠ Ġcalling ViewModel Provider . provide Confirm Leave Overlay ViewModel () ĊĠĠĠ Ġprivate Ġval Ġlocal Participant ViewModel Ġ= ĊĠĠĠĠĠĠĠ Ġcalling ViewModel Provider . provide Local Participant ViewModel () ĊĠĠĠ Ġprivate Ġval Ġfloating Header ViewModel Ġ= Ġcalling ViewModel Provider . provide Floating Header ViewModel () ĊĠĠĠ Ġprivate Ġval Ġaudio Device List ViewModel Ġ= ĊĠĠĠĠĠĠĠ Ġcalling ViewModel Provider . provide Audio Device List ViewModel () ĊĠĠĠ Ġprivate Ġval Ġparticipant List ViewModel Ġ= ĊĠĠĠĠĠĠĠ Ġcalling ViewModel Provider . provide Participant List ViewModel () ĊĠĠĠ Ġprivate Ġval Ġbanner ViewModel Ġ= Ġcalling ViewModel Provider . provide Banner ViewModel () ĊĠĠĠ Ġprivate Ġval Ġlob by Overlay ViewModel Ġ= Ġcalling ViewModel Provider . provide Lobby Overlay ViewModel () ĊĊĠĠĠ Ġfun Ġget Lobby Overlay ViewModel (): ĠL obby Overlay ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġlob by Overlay ViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Participant Grid ViewModel (): ĠPart icipant Grid ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġparticipant Grid ViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Audio Device List ViewModel (): ĠAudio Device List ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġaudio Device List ViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Control Bar ViewModel (): ĠControl Bar ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcontrol Bar ViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Confirm Leave Overlay ViewModel (): ĠLeave Confirm ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġconfirm Leave Overlay ViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Local Participant ViewModel (): ĠLocal Participant ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġlocal Participant ViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Floating Header ViewModel (): ĠInfo Header ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġfloating Header ViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Participant List ViewModel (): ĠPart icipant List ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġparticipant List ViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Banner ViewModel (): ĠBanner ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġbanner ViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġswitch Floating Header () Ġ{ ĊĠĠĠĠĠĠĠ Ġfloating Header ViewModel . switch Floating Header () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġrequest Call End () Ġ{ ĊĠĠĠĠĠĠĠ Ġconfirm Leave Overlay ViewModel . request Exit Confirmation () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinit ( coroutine Scope : ĠCor outine Scope ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġstate Ġ= Ġstore . getCurrent State () ĊĊĠĠĠĠĠĠĠ Ġcontrol Bar ViewModel . init ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . permission State , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . camera State , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . audio State ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġlocal Participant ViewModel . init ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . displayName , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . audio State . operation , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . video Stream ID , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . remote Participant State . participant Map . count (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . call State . calling Status , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . camera State . device , ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġfloating Header ViewModel . init ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . call State . calling Status , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . remote Participant State . participant Map . count () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġaudio Device List ViewModel . init ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . audio State ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġbanner ViewModel . init ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . call State ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġparticipant List ViewModel . init ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . remote Participant State . participant Map , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġlob by Overlay ViewModel . init ( state . call State . calling Status ) ĊĊĠĠĠĠĠĠĠ Ġparticipant Grid ViewModel . init ( state . call State . calling Status ) ĊĊĠĠĠĠĠĠĠ Ġsuper . init ( coroutine Scope ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġon StateChange ( state : ĠRedux State ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġif Ġ( state . lifecycle State . state Ġ== ĠLifecycle Status . BACKGROUND ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġparticipant Grid ViewModel . clear () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlocal Participant ViewModel . clear () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġcontrol Bar ViewModel . update ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . permission State , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . camera State , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . audio State ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġlocal Participant ViewModel . update ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . displayName , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . audio State . operation , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . video Stream ID , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . remote Participant State . participant Map . count (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . call State . calling Status , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . camera State . device , ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġaudio Device List ViewModel . update ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State . audio State , ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġlob by Overlay ViewModel . update ( state . call State . calling Status ) ĊĊĠĠĠĠĠĠĠ Ġparticipant Grid ViewModel . update Is Lobby Overlay Displayed ( state . call State . calling Status ) ĊĊĠĠĠĠĠĠĠ Ġif Ġ( should Update Remote Participants ViewModels ( state )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġparticipant Grid ViewModel . update ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstate . remote Participant State . modified Timestamp , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstate . remote Participant State . participant Map , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġfloating Header ViewModel . update ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstate . remote Participant State . participant Map . count () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġparticipant List ViewModel . update ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstate . remote Participant State . participant Map , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstate . local Participant State ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġbanner ViewModel . update ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstate . call State ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġupdate Lobby Overlay Displayed State ( state . call State . calling Status ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġshould Update Remote Participants ViewModels ( state : ĠRedux State ) Ġ= ĊĠĠĠĠĠĠĠ Ġstate . call State . calling Status Ġ== ĠCalling Status . CONNECTED ĊĊĠĠĠ Ġprivate Ġfun Ġupdate Lobby Overlay Displayed State ( calling Status : ĠCalling Status ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfloating Header ViewModel . update Is Lobby Overlay Displayed ( calling Status ) ĊĠĠĠĠĠĠĠ Ġbanner ViewModel . update Is Lobby Overlay Displayed ( calling Status ) ĊĠĠĠĠĠĠĠ Ġlocal Participant ViewModel . update Is Lobby Overlay Displayed ( calling Status ) ĊĠĠĠ Ġ} Ċ } Ċ