• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps partially changing edit text bottom line color

I need to partially change the edit text line color as the user types the input only for that length of text the line below should change the color.

I tried using text watcher and
email.getBackground().setColorFilter(getResources().getColor(R.color.black), PorterDuff.Mode.SRC_IN);
but that changes the color of complete line. Could someone please help me here ?
I have been stuck on this for quite sometime.

textWatcher = new TextWatcher() {
@override
public void onTextChanged(CharSequence s, int start, int before, int count) {

email.getBackground().setColorFilter(getResources().getColor(R.color.black), PorterDuff.Mode.SRC_IN);
}
@override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@override
public void afterTextChanged(Editable s) {}
 

Attachments

  • AND_CA-10.png
    AND_CA-10.png
    28.1 KB · Views: 126
I need to partially change the edit text line color as the user types the input only for that length of text the line below should change the color.

I tried using text watcher and
email.getBackground().setColorFilter(getResources().getColor(R.color.black), PorterDuff.Mode.SRC_IN);
but that changes the color of complete line. Could someone please help me here ?
I have been stuck on this for quite sometime.

textWatcher = new TextWatcher() {
@override
public void onTextChanged(CharSequence s, int start, int before, int count) {

email.getBackground().setColorFilter(getResources().getColor(R.color.black), PorterDuff.Mode.SRC_IN);
}
@override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@override
public void afterTextChanged(Editable s) {}
I need to partially change the edit text line color as the user types the input only for that length of text the line below should change the color.

I tried using text watcher and
email.getBackground().setColorFilter(getResources().getColor(R.color.black), PorterDuff.Mode.SRC_IN);
but that changes the color of complete line. Could someone please help me here ?
I have been stuck on this for quite sometime.

textWatcher = new TextWatcher() {
@override
public void onTextChanged(CharSequence s, int start, int before, int count) {

email.getBackground().setColorFilter(getResources().getColor(R.color.black), PorterDuff.Mode.SRC_IN);
}
@override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@override
public void afterTextChanged(Editable s) {}
 
Back
Top Bottom