Я пытаюсь создать TextInputEditText, цвет плавающей подсказки которого не изменится, если он не сфокусирован.Цвет подсказки меняется с белого на синий, т. Е. На цвет, заданный в поле textColorHint
.
![enter image description here](https://i.stack.imgur.com/rH97G.jpg)
Это происходит только тогда, когда TextInputEditTextзаполнен и не сфокусирован.Я хочу, чтобы подсказка была белой, когда она выше TextInputEditText, и синей, когда она внутри поля.Когда TextInputEditText не пустой и не сфокусированный, цвет подсказки становится синим.
![enter image description here](https://i.stack.imgur.com/et8sQ.jpg)
TextInputEditText
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="4dp"
android:textColorHint="@color/app_blue"
app:hintTextAppearance="@style/TextAppearance.App.TextInputLayout"
app:layout_constraintEnd_toStartOf="@+id/guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/fNameET"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/text_input_layout_background"
android:ellipsize="end"
android:hint="First Name"
android:lines="1"
android:maxLines="1"
android:paddingStart="16dp"
android:paddingEnd="16dp" />
</com.google.android.material.textfield.TextInputLayout>
TextAppearance.App.TextInputLayout
<style name="TextAppearance.App.TextInputLayout" parent="@android:style/TextAppearance">
<item name="android:textColor">@android:color/white</item>
</style>
И я хочу использовать xml для выполнения вышеуказанной задачи, а не Java.