Reputation: 300
I want to merge animations in android application. I'm using below code for that,but alpha animation not wrking. I have no idea why it is not working.
// create set of animations
AnimationSet login_page_animation = new AnimationSet(false);
// animations should be applied on the finish line
login_page_animation.setFillAfter(true);
// create scale animation
int white_background_height=((TextView) findViewById(R.id.login_white_backgroud)).getHeight();
TranslateAnimation translate_animation = new TranslateAnimation(0,0,0,- white_background_height/4);
translate_animation.setDuration(700);
// create Alpha animation
AlphaAnimation alpha_animation=new AlphaAnimation(0.0f,1.0f);
alpha_animation.setDuration(700);
// add new animations to the set
login_page_animation.addAnimation(translate_animation);
login_page_animation.addAnimation(translate_animation);
Upvotes: 0
Views: 366
Reputation: 111
Looks like you're adding translate_animation
again on that last line instad of alpha_animation
.
Upvotes: 2