package Ġcom . ib ash k imi . lock scheduler . profiles Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . as LiveData Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . ib ash k imi . lock scheduler . model . Profile Ċ import Ġcom . ib ash k imi . lock scheduler . manager . Profile Manager Ċ import Ġkotlinx . coroutines . launch Ċ Ċ class ĠPro files ViewModel Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġrepository Ġ= ĠProfile Manager ĊĊĠĠĠ Ġval Ġprofiles : ĠLive Data < List < Profile >> Ġ= Ġrepository . get Profiles Flow (). as LiveData () ĊĊĠĠĠ Ġfun Ġdelete ( profile Id : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ Ġrepository . remove ( profile Id ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġswap Profiles ( profile 1 : ĠProfile , Ġprofile 2 : ĠProfile ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ Ġrepository . swap ( profile 1 , Ġprofile 2 ) Ġ} ĊĠĠĠ Ġ} Ċ } Ċ