简体   繁体   中英

Android talk back announcing incorrect content description for TextInputLayout when the the input type of EditText is password

I have a TextInputLayout with the following structure in my android app.

<com.google.android.material.textfield.TextInputLayout
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:imeOptions="actionDone"
        android:id="@+id/mEdit"
        android:inputType="numberPassword"
        android:maxLength="4"
        android:singleLine="true"
        app:layout_constraintTop_toTopOf="parent" />

</com.google.android.material.textfield.TextInputLayout>

Here the maxLength of EditText is 4 . However, after enabling talk back if we try to edit something into the password field the talkback announces content description like Bullet, Maximum length reached even if we didn't reach the maxLength of the EditText .

输入第三个密码字符时显示不正确的内容描述

Thanks in advance for your valuable thoughts.

Use com.google.android.material.textfield.TextInputEditText instead of using EditText in TextInputLayout .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM