Center Hint with password view icon

0
Hello, I'm using gravity to leave the hint of TextInputLayout centralized, it works to some extent, because when I add some icon next to the passwordToggleEnabled hint is not centered, it goes a little to the left, the same happens when the icon of seterror appears.

XML:

    <android.support.design.widget.TextInputLayout
    android:id="@+id/textInputLayout2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:paddingTop="5dp"
    app:passwordToggleEnabled="true"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/textInputLayout">
    <android.support.design.widget.TextInputEditText
        android:id="@+id/edtnovasenha"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:hint="@string/Senha"
        android:inputType="textPassword"
        android:textSize="16sp" />
</android.support.design.widget.TextInputLayout>
    
asked by anonymous 06.02.2018 / 12:13

0 answers