I needed a recipient EditText in my app, so, I used this TokenAutoComplete library to do the same. However, I am having a few problem with this.
- When I type a name, a drop down list comes. I want to give a custom layout to this drop down list. How can I do it? Currently I am showing just text here using toString method.
Below is the code.
@Override
public String toString() { return mContactFirstName }
I want to show here name and photo together. How can I do it?
- Changing the layout for selected token. When the token is not selected/default, the token's background is white and it's text color is black. On the other hand, if the token is selected, the token's background should be black and it's text color should be white colored. I used a selector xml to change the token's background, however, I don't know how to change the text's color.
The selector xml is working perfectly fine and the background is changing when the token is selected and unselected, but, the text's color remains same.
I used below setSelected() method to change the text's color. But it's not working.
@Override
public void setSelected(boolean selected) {
super.setSelected(selected);
TextView tv = (TextView) findViewById(R.id.token_name);
if(selected) {
tv.setTextColor(Color.WHITE);
} else {
tv.setTextColor(Color.BLACK);
}
}
Please help me out.