Skip to content

Instantly share code, notes, and snippets.

@d4rkc0de
Last active February 11, 2017 10:50
Show Gist options
  • Save d4rkc0de/d68418957766fecf1ab3714177488d32 to your computer and use it in GitHub Desktop.
Save d4rkc0de/d68418957766fecf1ab3714177488d32 to your computer and use it in GitHub Desktop.
AnimatorSet set = new AnimatorSet();
set.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
set.playTogether(
ObjectAnimator.ofFloat(text1_textView, View.ALPHA, 0,1),
ObjectAnimator.ofFloat(text2_textView, View.ALPHA, 0,1),
ObjectAnimator.ofFloat(skip_this_step_textView, View.ALPHA, 0,1),
ObjectAnimator.ofFloat(text3_textView, View.ALPHA, 0,1),
ObjectAnimator.ofFloat(take_photo_button, View.ALPHA, 0,1)
);
set.setDuration(1000);
set.start();
// Or using xml object animator
ObjectAnimator slide_right_animation = (ObjectAnimator) AnimatorInflater.loadAnimator(getApplicationContext(), R.animator.slide_right_animation);
slide_right_animation.setTarget(first_name_question_container);
ObjectAnimator slide_left_animation = (ObjectAnimator) AnimatorInflater.loadAnimator(getApplicationContext(), R.animator.slide_left_animation);
slide_left_animation.setTarget(name_question_container);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment