|
|
|
@ -1118,6 +1118,17 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
String wildcard = "%" + typed + "%";
|
|
|
|
|
Map<String, EntityContact> map = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
String glob = "*" +
|
|
|
|
|
typed.toString().toLowerCase()
|
|
|
|
|
.replaceAll("[aáàäâã]", "\\[aáàäâã\\]")
|
|
|
|
|
.replaceAll("[eéèëê]", "\\[eéèëê\\]")
|
|
|
|
|
.replaceAll("[iíìî]", "\\[iíìî\\]")
|
|
|
|
|
.replaceAll("[oóòöôõ]", "\\[oóòöôõ\\]")
|
|
|
|
|
.replaceAll("[uúùüû]", "\\[uúùüû\\]")
|
|
|
|
|
.replace("*", "[*]")
|
|
|
|
|
.replace("?", "[?]") +
|
|
|
|
|
"*";
|
|
|
|
|
|
|
|
|
|
boolean contacts = Helper.hasPermission(getContext(), Manifest.permission.READ_CONTACTS);
|
|
|
|
|
if (contacts) {
|
|
|
|
|
Cursor cursor = resolver.query(
|
|
|
|
@ -1130,8 +1141,9 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
},
|
|
|
|
|
ContactsContract.CommonDataKinds.Email.DATA + " <> ''" +
|
|
|
|
|
" AND (" + ContactsContract.Contacts.DISPLAY_NAME + " LIKE ?" +
|
|
|
|
|
" OR LOWER(" + ContactsContract.Contacts.DISPLAY_NAME + ") GLOB ?" +
|
|
|
|
|
" OR " + ContactsContract.CommonDataKinds.Email.DATA + " LIKE ?)",
|
|
|
|
|
new String[]{wildcard, wildcard},
|
|
|
|
|
new String[]{wildcard, glob, wildcard},
|
|
|
|
|
null);
|
|
|
|
|
|
|
|
|
|
while (cursor != null && cursor.moveToNext()) {
|
|
|
|
|