Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save EbenezerGH/42d9bce3b24e15a140ec to your computer and use it in GitHub Desktop.
Save EbenezerGH/42d9bce3b24e15a140ec to your computer and use it in GitHub Desktop.
Pretty Cool Animation
private void showAnswerAnimation() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
int cx = mShowAnswer.getWidth() / 2;
int cy = mShowAnswer.getHeight() / 2;
float radius = mShowAnswer.getWidth();
Animator anim = ViewAnimationUtils
.createCircularReveal(mShowAnswer, cx, cy, radius, 0);
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mAnswerTextView.setVisibility(View.VISIBLE);
mShowAnswer.setVisibility(View.INVISIBLE);
}
}
);
anim.start();
} else {
mAnswerTextView.setVisibility(View.VISIBLE);
mShowAnswer.setVisibility(View.INVISIBLE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment