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
  • 60,783
  • 13
  • 169
  • 249
AskQ
  • 4,215
  • 7
  • 34
  • 61

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
  • 60,783
  • 13
  • 169
  • 249