Поэтому я пытаюсь убедиться, что основной текст в TextInputEditText
(обернутый в TextInputLayout
) по центру по вертикали со стилем Widget.MaterialComponents.TextInputLayout.FilledBox
по умолчанию, но когда подсказка отключена.
Как Вы можете видеть на изображении, с app:hintEnabled="false"
, текущий текст не центрирован по вертикали.
Для справки я использую версию 1.1.0 библиотеки компонентов материала.
Мой макет файл:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin"
app:hintEnabled="false">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/set_pos_password_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:importantForAutofill="no"
android:maxLength="4"
android:text="1111"
android:textAlignment="center" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
Результат:
![result](https://i.stack.imgur.com/Cbkvv.png)