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
Programmatic solution:
You can use drawable.setBounds
but it requires pixels rather than dp as parameters.
how to convert: Converting pixels to dp
code:
Drawable drawable = getDrawable(R.drawable.ic_your_drawable);
int size = dp2px(this, dpSize);
if (drawable != null) {
drawable.setBounds(0, 0, size, size);
}
textView.setCompoundDrawables(drawable, drawable, drawable, drawable);