How to change the hint color,underline color hint text,if edit text is empty and unfocused in android? -


i have 2 edit text.first 1 email , second 1 password field.
when click login button without filling both fields, hint color , underline changes red color in both fields unfocused state.
unfocused state @ landing page, color should in blue colorenter image description here while clicking login without filling fields in unfocused stateenter image description here.

this requirement.
have tried possible ways achieve scenario.
cant control focused , unfocused state.
please guide me solve issues.

<style name="mymaterialtheme.base" parent="theme.appcompat.light.darkactionbar"> <item name="windownotitle">true</item> <item name="windowactionbar">false</item> <item name="colorprimary">@color/colorprimary</item> <item name="colorprimarydark">@color/colorprimarydark</item> <item name="coloraccent">@color/coloraccent</item> <item name="colorcontrolactivated">@color/primary</item> <item name="colorcontrolhighlight">@color/colorprimary</item> </style> 

i want change hint color,underline color in unfocused state programmatically.

colors.xml

<resources> <color name="primary">#1976d2</color> <color name="primary_dark">#e12929</color> <color name="primary_darker">#cc1d1d</color> <color name="accent">#000000</color> <color name="blue">#1976d2</color> <color name="black">#000000</color> <color name="lightblue">#1976d2</color> <color name="lightgray">#666666</color> </resources> 

something should try

<android.support.design.widget.textinputlayout android:id="@+id/usernamewrapper" android:layout_width="match_parent" android:layout_height="wrap_content">  <edittext     android:id="@+id/username"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:inputtype="textemailaddress"     android:hint="username"/>  </android.support.design.widget.textinputlayout> 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -