Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c03cfc04 authored by Gary Mai's avatar Gary Mai
Browse files

Format phone numbers when inserting a new contact

Set formatAfterWatcherSet to true when inserting a new contact.

Test:
Tested opening and closing a contact with an unformatted number
doesn't prompt to discard changes.
Tested adding a new contact from Allo has formatted number.

Bug: 26754145
Change-Id: I82546e86aec1e901e9b508eeaf7b87cf9f28d22f
parent 87de7495
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -228,7 +228,8 @@ public class TextFieldsEditorView extends LabeledEditorView {
            fieldView.setInputType(inputType);
            if (inputType == InputType.TYPE_CLASS_PHONE) {
                PhoneNumberFormatter.setPhoneNumberFormattingTextWatcher(
                        getContext(), fieldView, /* formatAfterWatcherSet =*/ false);
                        getContext(), fieldView,
                        /* formatAfterWatcherSet =*/ state.isContactInsert());
                fieldView.setTextDirection(View.TEXT_DIRECTION_LTR);
            }
            fieldView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);