package Ġcom . col lege . col lege connect . settings Activity . models Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroidx . lifecycle . Android ViewModel Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . col lege . col lege connect . database . Download Database Ċ import Ġcom . col lege . col lege connect . database . entity . Download Entity Ċ import Ġcom . col lege . col lege connect . data models . Constants Ċ import Ġcom . col lege . col lege connect . data models . Upload Ċ import Ġcom . col lege . col lege connect . settings Activity . repository . Upload s Repository Ċ import Ġcom . col lege . col lege connect . utils . Firebase Util Ċ import Ġkotlinx . coroutines . launch Ċ Ċ class ĠMy Files ViewModel ( application : ĠApplication ) Ġ: Android ViewModel ( application ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġreference Ġ= ĠFirebase Util . get Database (). getReference ( Constants . DATABASE _ PATH _ UPLOAD S ) ĊĠĠĠ Ġprivate Ġval Ġfetch Upload s Ġ= ĠUp loads Repository ( reference ) ĊĊĠĠĠ Ġfun Ġget Upload s (): LiveData < ArrayList < Upload >> { ĊĠĠĠĠĠĠĠ Ġreturn Ġfetch Upload s ĊĠĠĠ Ġ} Ċ Ċ // ĠĠĠ Ġfun Ġget Downloads (): LiveData < List < Download Entity >> { Ċ // ĠĠĠĠĠĠĠ Ġreturn ĠDownload Database ( getApplication ()). get Downloads Dao (). get Download Files () Ċ // ĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġdelete Download ( id : Int ){ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠDownload Database ( getApplication ()). get Downloads Dao (). delete ( id ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }