package Ġcom . a ul iam na uf al . notes app . data Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġcom . a ul iam na uf al . notes app . data . local . entity . Notes Ċ import Ġcom . a ul iam na uf al . notes app . data . local . room . Notes Dao Ċ Ċ class ĠNote Repository ( private Ġval Ġnotes Dao : ĠNotes Dao ) Ġ{ ĊĊĠĠĠ Ġval ĠgetAll Notes : ĠLive Data < List < Notes >> Ġ= Ġnotes Dao . getAll Notes () ĊĊĠĠĠ Ġsuspend Ġfun Ġinsert Notes ( notes : ĠNotes ) Ġ{ ĊĠĠĠĠĠĠĠ Ġnotes Dao . add Notes ( notes ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġsearch Note By Query ( query : ĠString ) Ġ: ĠLive Data < List < Notes >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġnotes Dao . search Note By Query ( query ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval ĠsortBy High Priority : ĠLive Data < List < Notes >> Ġ= Ġnotes Dao . sortBy High Priority () ĊĠĠĠ Ġval ĠsortBy Low Priority : ĠLive Data < List < Notes >> Ġ= Ġnotes Dao . sortBy Low Priority () ĊĊĠĠĠ Ġsuspend Ġfun Ġdelete All Notes () Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġnotes Dao . delete All Notes () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġdelete Note ( note : ĠNotes ) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġnotes Dao . delete Note ( note ) ĊĠĠĠ Ġ} Ċ }