There is a TextView with a static background color and a dynamic (comes from the server on request every 10 seconds) text. How to make a blinking text animation (blinking for n seconds) when it is received? Standard animation through alpha blinks the whole TextView, including the background that doesn’t fit :(
- 7I think it will be easier to put a TextView in a container, and set the background at the container, and animate TextView itself - Vladyslav Matviienko
- Write the answer;) - Flippy
|
2 answers
Try this:
TextView myText = (TextView) findViewById(R.id.myText ); Animation anim = new AlphaAnimation(0.0f, 1.0f); anim.setDuration(50); anim.setStartOffset(20); anim.setRepeatMode(Animation.REVERSE); anim.setRepeatCount(Animation.INFINITE); myText.startAnimation(anim); |
^ put the TextView in the container, and set the background at the container, and animate the TextView itself. It really turned out to be easier :)
|