I want to have same color of hint in error and normal state
Ive given styles for error state and normal state, hint color shoukd remain grey color only in error state, and error text should be in red color
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LabelText" parent="TextAppearance.Internal.Label">
<!-- Hint color and label color in FALSE state -->
<item name="android:textColorHint">@color/grey_dark</item>
<!-- Label color in TRUE state and bar color FALSE and TRUE State -->
<item name="colorAccent">@color/grey_dark</item>
<item name="android:textColor">@color/grey_dark</item>
<item name="colorControlNormal">@color/grey_dark</item>
<item name="colorControlActivated">@color/grey_dark</item>
</style>
<style name="ErrorText" parent="TextAppearances.Internal.Note">
<item name="android:textColor">@color/red_primary</item>
<item name="android:textColorHint">@color/grey_dark</item>
<item name="colorAccent">@color/grey_dark</item>
<item name="colorControlNormal">@color/grey_dark</item>
<item name="colorControlActivated">@color/grey_dark</item>
</style>
<style name="Widget.TextField" parent="Widget.Design.TextInputLayout">
<!-- reference our hint & error styles -->
<item name="hintTextAppearance">@style/LabelText</item>
<item name="errorTextAppearance">@style/ErrorText</item>
<item name="android:textColor">@color/grey_darkest</item>
<item name="android:textColorHint">@color/grey_dark</item>
<item name="colorControlNormal">@color/grey_dark</item>
<item name="colorControlActivated">@color/blue_primary</item>
<item name="colorControlHighlight">@color/blue_primary</item>
</style>
</resources>
My Text Input layout code with styles given above
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/cdTextFieldLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
android:theme="@style/Widget.TextField"
app:errorTextAppearance="@style/ErrorText"
app:helperTextTextAppearance="@style/TextAppearance.Internal.Note"
app:hintTextAppearance="@style/LabelText">
<EditText
android:id="@+id/cdTextField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="-4dp"
android:paddingTop="4dp"
android:textAppearance="@style/TextAppearance.Internal.Body"
android:textColor="@color/grey_darkest"
android:textColorHint="@color/grey_dark"
tools:text="Input Text" />
</com.google.android.material.textfield.TextInputLayout>