Я пытаюсь изменить цвет атрибута startIconDrawable
для TextInputLayout
, когда состояние сфокусировано, но я не могу найти способ сделать это!
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/Login_Fragment_Email_Text_Input"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginStart="24dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="24dp"
android:background="@drawable/text_input_top_selector"
android:paddingTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/Login_Fragment_Logo_Image"
app:startIconDrawable="@drawable/profile"
app:startIconTint="@drawable/icon_color_edit_text_selector">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/Login_Fragment_Email_Edit_Text"
android:focusableInTouchMode="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="-8dp"
android:hint="@string/email"
android:paddingBottom="16dp"
android:theme="@style/CustomEditText" />
</com.google.android.material.textfield.TextInputLayout>
Я пытался сделатьэто путем создания icon_color_edit_text_selector.xml
, который содержит следующие
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorAccent" android:state_focused="true" />
<item android:color="@color/iconColor" android:state_focused="false"/>
</selector>
, но показывает только цвет по умолчанию state_focused ="false"