Skip to content

Commit

Permalink
Merge pull request #2 from scorillo/master
Browse files Browse the repository at this point in the history
Fix spaces in contact names to better match voice input
  • Loading branch information
f1xpl authored Jun 22, 2017
2 parents 53b4d24 + d2adce7 commit 8093f7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/java/com/f1x/mtcdialer/PhoneBookActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ protected void onServiceConnected() {
private void buildPhoneBook(List<String> phoneBookRecords) {
for(String phoneBookRecord : phoneBookRecords) {
String[] parsedRecord = phoneBookRecord.split("\\^");
String contactName = parsedRecord[0].replaceAll("\\s+", " ").replaceAll("\\s+$", "");
String phoneNumber = parsedRecord[1].replaceAll("[^\\d\\+]", "");

mPhoneBookRecords.put(parsedRecord[0], phoneNumber);
mPhoneBookRecords.put(contactName, phoneNumber);
}
}

Expand Down

0 comments on commit 8093f7c

Please sign in to comment.