package Ġcom . sz ir aki apps . aud i ore c order plugin . view model Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroid . net . Uri Ċ import Ġandroidx . lifecycle . Android ViewModel Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġcom . sz ir aki apps . aud i ore c order plugin . di . Context Component Ċ import Ġcom . sz ir aki apps . aud i ore c order plugin . model . service . Recorder Service Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠMain ViewModel ( application : ĠApplication ) Ġ: ĠAndroid ViewModel ( application ) Ġ{ ĊĊĠĠĠ Ġval Ġis Recording : ĠMutable LiveData < Boolean > ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġrecorder Service . is Recording ĊĊĠĠĠ Ġval Ġcurrent Voice Amp litude : ĠMutable LiveData < Double > ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġrecorder Service . current Voice Amp litude ĊĊĠĠĠ Ġval Ġelapsed Millis : ĠMutable LiveData < Long > ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġrecorder Service . elapsed Millis ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġrecorder Service : ĠRec order Service ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠContext Component . build ( application ). inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Cle ared () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Cle ared () ĊĠĠĠĠĠĠĠ Ġrecorder Service . cleanup () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġis Pause Resume Supported (): ĠBoolean Ġ= Ġrecorder Service . is Pause Resume Supported () ĊĊĠĠĠ Ġfun Ġstart Recording ( uri : ĠUri ) Ġ= Ġrecorder Service . start Recording ( uri ) ĊĊĠĠĠ Ġfun Ġresume Recording ( uri : ĠUri ) Ġ= Ġrecorder Service . resume Recording ( uri ) ĊĊĠĠĠ Ġfun Ġpause Recording () Ġ= Ġrecorder Service . pause Recording () ĊĊĠĠĠ Ġfun Ġstop Recording () Ġ= Ġrecorder Service . stop Recording () Ċ } Ċ