Blink Animation in android
Here I write code for blinking any components like TextView, ImageView etc.
Here I just use AlphaAnimation class of Animation .
TextView textMessageCenter;
textMessageCenter = (TextView)rootView.findViewById(R.id.text_message_center);
textMessageCenter.setText("Hello! How are you?")
final Animation animation = new AlphaAnimation(1, 0); // Change alpha from fully visible to invisible
animation.setDuration(500); // duration - half a second
animation.setInterpolator(new LinearInterpolator()); // do not alter animation rate
animation.setRepeatCount(Animation.INFINITE); // Repeat animation infinitely
animation.setRepeatMode(Animation.REVERSE); // Reverse animation at the end so the textview will fade back in
textMessageCenter.startAnimation(animation);
0 Comment(s)