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

Commit cea26c00 authored by Daisuke Miyakawa's avatar Daisuke Miyakawa Committed by Android (Google) Code Review
Browse files

Merge "Suppress tts on every digits change"

parents 59853614 2d52f464
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.graphics.Rect;
import android.text.InputType;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.accessibility.AccessibilityEvent;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

@@ -54,4 +55,14 @@ public class DigitsEditText extends EditText {
        }
        return ret;
    }

    @Override
    public void sendAccessibilityEventUnchecked(AccessibilityEvent event) {
        if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED) {
            // AsYouTypeFormatter frequently replaces digits with formatted ones, which makes
            // tts too verbose. Let's ignore the whole event.
            return;
        }
        super.sendAccessibilityEventUnchecked(event);
    }
}
 No newline at end of file