Prefix and suffix are not shown when endIcon is set
natario1 opened this issue · 1 comments
natario1 commented
Just as per title.
If I set an endIcon the prefix and suffix are not drawn anymore (the text drawable does not go through onDraw). Why is this?
natario1 commented
More info:
- call setPrefix("something") - this sets the left compound drawable
- call setEndIcon - this calls
updateClearAndEndIconLayout()
In that method you ask for getCompoundDrawablesRelative()
.
I would expect the first one (or third for RTL) to be the prefix drawable, instead, it is null.
If you replace getCompoundDrawablesRelative()
with getCompoundDrawables()
, the first one is correctly not null. I don't know why.
Also for RTL devices (not my case) this method explicitly replaces the prefix drawable with the password toggle dummy drawable, because left == end. To avoid all this I think that the EditText should not use compound drawables but rather padding and draw onDraw.