Search in sources :

Example 1 with FlipAnimation

use of com.teatime.library_teatime.Animation.FlipAnimation in project teaTime by ancfdy.

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);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) FlipAnimation(com.teatime.library_teatime.Animation.FlipAnimation) FlipAnimation(com.teatime.library_teatime.Animation.FlipAnimation) Animation(android.view.animation.Animation) ImageView(android.widget.ImageView) View(android.view.View)

Example 2 with FlipAnimation

use of com.teatime.library_teatime.Animation.FlipAnimation in project teaTime by ancfdy.

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);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) FlipAnimation(com.teatime.library_teatime.Animation.FlipAnimation) FlipAnimation(com.teatime.library_teatime.Animation.FlipAnimation) Animation(android.view.animation.Animation) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

View (android.view.View)2 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)2 Animation (android.view.animation.Animation)2 ImageView (android.widget.ImageView)2 FlipAnimation (com.teatime.library_teatime.Animation.FlipAnimation)2