use of yalantis.com.sidemenu.animation.FlipAnimation in project Side-Menu.Android by Yalantis.
the class ViewAnimator method animateView.
private void animateView(int position) {
final View view = viewList.get(position);
view.setVisibility(View.VISIBLE);
FlipAnimation rotation = new FlipAnimation(90, 0, 0.0f, view.getHeight() / 2.0f);
rotation.setDuration(ANIMATION_DURATION);
rotation.setFillAfter(true);
rotation.setInterpolator(new AccelerateInterpolator());
rotation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
view.clearAnimation();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
view.startAnimation(rotation);
}
use of yalantis.com.sidemenu.animation.FlipAnimation in project Side-Menu.Android by Yalantis.
the class ViewAnimator method animateHideView.
private void animateHideView(final int position) {
final View view = viewList.get(position);
FlipAnimation rotation = new FlipAnimation(0, 90, 0.0f, view.getHeight() / 2.0f);
rotation.setDuration(ANIMATION_DURATION);
rotation.setFillAfter(true);
rotation.setInterpolator(new AccelerateInterpolator());
rotation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
view.clearAnimation();
view.setVisibility(View.INVISIBLE);
if (position == viewList.size() - 1) {
animatorListener.enableHomeButton();
drawerLayout.closeDrawers();
}
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
view.startAnimation(rotation);
}
Aggregations