2

I have icon set as android:drawableLeft to TextView.

I want to apply some appearance changes some methods to that Drawable. Since I don't have it's id, I am not able to manipulate its appearance.

Just let me know how to get it's id so that I have its object somehow?

azizbekian
  • 58,054
  • 12
  • 164
  • 238
AskQ
  • 3,974
  • 6
  • 28
  • 59

1 Answers1

1

Just let me know how to get it's id.

I assume, that by saying that you expect to receive an id of a View, and then to perform animations on that View. But, as you know, TextView is a descendant of a View, not ViewGroup, thus it's not possible for TextView to compound multiple Views. Instead, TextView lays out a Drawable instance.

You can get that Drawable and perform animations on that Drawable directly.

getCompoundDrawables() will return Drawable[] array filled with left, top, right, and bottom Drawables.

Community
  • 1
  • 1
azizbekian
  • 58,054
  • 12
  • 164
  • 238