Reputation: 6846
I want to fade in and out a Button in my android app when user activates a feature. I saw examples on stackoverflow that shows fading in or out. But is there an easy way to combine in/out animations all together that repeats unlimited amount of time?
Upvotes: 0
Views: 561
Reputation: 1670
I am not 100% sure about your question, but this worked for me as a continue fadeOut and fadeIn animation:
int value = 0;
for (int i=0;i<100000;i++){
if (value == 0){
doFadeOutAnimation();
value = 1;
}
else if (value == 1){
doFadeInAnimation();
value = 0;
}
}
Upvotes: 1
Reputation: 72341
Use on your Animation
object the following :
myAnimation.setRepeatCount(Animation.INFINITE);
myAnimation.setRepeatMode(Animation.REVERSE);
Upvotes: 2