Mark local contacts

pull/172/head
M66B 5 years ago
parent 891252bf3e
commit 2fc85244d5

@ -58,7 +58,7 @@ public interface DaoContact {
" AND email = :email COLLATE NOCASE")
EntityContact getContact(long account, int type, String email);
@Query("SELECT id AS _id, name, email" +
@Query("SELECT id AS _id, name, email, name || ' *' AS display" +
" FROM contact" +
" WHERE (:account IS NULL OR account = :account)" +
" AND (:type IS NULL OR type = :type)" +

@ -668,7 +668,7 @@ public class FragmentCompose extends FragmentBase {
getContext(),
R.layout.spinner_item2_dropdown,
null,
new String[]{"name", "email"},
new String[]{"display", "email"},
new int[]{android.R.id.text1, android.R.id.text2},
0);
@ -701,7 +701,7 @@ public class FragmentCompose extends FragmentBase {
String wildcard = "%" + typed + "%";
List<Cursor> cursors = new ArrayList<>();
MatrixCursor provided = new MatrixCursor(new String[]{"_id", "name", "email"});
MatrixCursor provided = new MatrixCursor(new String[]{"_id", "name", "email", "display"});
boolean contacts = Helper.hasPermission(getContext(), Manifest.permission.READ_CONTACTS);
if (contacts) {
Cursor cursor = resolver.query(
@ -723,7 +723,8 @@ public class FragmentCompose extends FragmentBase {
provided.newRow()
.add(cursor.getLong(0))
.add(cursor.getString(1))
.add(cursor.getString(2));
.add(cursor.getString(2))
.add(cursor.getString(1));
}
cursors.add(provided);

Loading…
Cancel
Save