I am having an issue with the TextInputLayout error state. When I set the error on the TextInputLayout, then error message is red, along with the underline, but the hint does not (it stays the default colour - grey). I have played around with setting the errorTextAppearance, yet I cannot seem to get the hint text to change colour.
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="My Hint"
app:errorTextAppearance="@style/MyErrorTextAppearance">
<android.support.design.widget.TextInputEditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:maxLength="10"
android:maxLines="1" />
styles.xml
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="MyErrorTextAppearance" parent="TextAppearance.Design.Error">
<item name="android:textColor">@color/colorError</item>
</style>
I set and clear the error as follows:
myTextInputLayout.setErrorEnabled(true);
myTextInputLayout.setError(errorMessage);
myTextInputLayout.setError(null);
myTextInputLayout.setErrorEnabled(false);