Reputation: 2619
I want to add simple fade animation over EditText on setting the left or right drawable.
Is there any simple workaround for this?
edtText.setCompoundDrawablesWithIntrinsicBounds(0,
0, drawableResId, 0)
Upvotes: 1
Views: 105
Reputation: 18002
If your drawable is animated like an AnimationDrawable you could do:
AnimationDrawable d = (AnimationDrawable) getResources()
.getDrawable(R.drawable.whatever_drawable);
edtText.setCompoundDrawablesWithIntrinsicBounds(null, null, d, null);
d.start();
d.start
should start the animation and at some point you should call d.stop()
to stop it.
Upvotes: 1