Android-Lint gives me this hint in some cases:
This tag and its children can be replaced by one and a compound drawable
I cou
@Oleksandr answer is the best one especially if your are going to change the Drawable programmatically, but you should add :
@Override
public void setCompoundDrawablesRelativeWithIntrinsicBounds(int start, int top, int end, int bottom) {
super.setCompoundDrawablesRelativeWithIntrinsicBounds(start, top, end, bottom);
initCompoundDrawableSize();
}
so it will Re-Calculate whenever Coumpounds is changed.