0

After corrected entering email address (or addresses) in gmail, we got frame around this address, such as in the picture below:

enter image description here

How can I do something similar in case of Android and EditText? Are there any validation-libraries which do it automatically? (I know that probably I can draw something using shapes, but it doesn't look so easy...).

EDIT. I've already found out about good library, and it works well. https://github.com/splitwise/TokenAutoComplete

Mkr
  • 428
  • 2
  • 5
  • 16
  • 1
    http://stackoverflow.com/questions/19100228/edittext-change-background-color-of-text-and-only-text-not-the-whole-view – Raghunandan Mar 11 '14 at 17:54

1 Answers1

1

Don't know about the validation library. But for background of edittext you can use addTextChangedListener(). In it's onTextChanged() method check for the key you want to assign for triggering the validation. If validation result is successful than you can create a textveiw programatically change it's background, assign the value of that validated email address to the textview and place that text view inside the edit text.

Vaibhav Ajay Gupta
  • 463
  • 2
  • 4
  • 18