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

Commit b091a934 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix tts span on Editable" into tm-qpr-dev am: 591a11a4

parents 249f21f4 591a11a4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.os.Build;
import android.text.Editable;
import android.text.Selection;
import android.text.TextWatcher;
import android.text.style.TtsSpan;

import com.android.i18n.phonenumbers.AsYouTypeFormatter;
import com.android.i18n.phonenumbers.PhoneNumberUtil;
@@ -119,6 +120,13 @@ public class PhoneNumberFormattingTextWatcher implements TextWatcher {
            }
            mSelfChange = false;
        }

        //remove previous TTS spans
        TtsSpan[] ttsSpans = s.getSpans(0, s.length(), TtsSpan.class);
        for (TtsSpan ttsSpan : ttsSpans) {
            s.removeSpan(ttsSpan);
        }

        PhoneNumberUtils.ttsSpanAsPhoneNumber(s, 0, s.length());
    }