Skip to content

Commit

Permalink
Fix spaces in contact names to better match voice input
Browse files Browse the repository at this point in the history
  • Loading branch information
scorillo committed Jun 22, 2017
1 parent 7302668 commit d2adce7
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 d2adce7

Please sign in to comment.