Added favorite local contacts

This commit is contained in:
M66B
2019-03-15 08:36:23 +00:00
parent cbf1a41c1f
commit f420104775
7 changed files with 1669 additions and 9 deletions

View File

@@ -35,11 +35,11 @@ public interface DaoContact {
List<EntityContact> getContacts();
@Query("SELECT * FROM contact" +
" ORDER BY times_contacted DESC, last_contacted DESC")
" ORDER BY favorite DESC, times_contacted DESC, last_contacted DESC")
LiveData<List<EntityContact>> liveContacts();
@Query("SELECT * FROM contact" +
" ORDER BY times_contacted DESC, last_contacted DESC" +
" ORDER BY favorite DESC, times_contacted DESC, last_contacted DESC" +
" LIMIT :count")
List<EntityContact> getFrequentlyContacted(int count);
@@ -66,6 +66,9 @@ public interface DaoContact {
@Update
int updateContact(EntityContact contact);
@Query("UPDATE contact SET favorite = :favorite WHERE id = :id")
int setContactFavorite(long id, boolean favorite);
@Query("DELETE from contact")
int clearContacts();
}