Search in sources :

Example 86 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project DropListView by ufo22940268.

the class DropListView method getDropViewScrollAnimator.

private ValueAnimator getDropViewScrollAnimator(int to) {
    ValueAnimator restoreAnimator = ValueAnimator.ofFloat(mHeaderView.getBottom(), to);
    restoreAnimator.setDuration(getResources().getInteger(android.R.integer.config_shortAnimTime));
    restoreAnimator.setInterpolator(new AccelerateInterpolator());
    restoreAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            float v = ((Float) (animation.getAnimatedValue())).floatValue();
            updateDropviewScroll((int) v);
        }
    });
    return restoreAnimator;
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ValueAnimator(com.nineoldandroids.animation.ValueAnimator)

Example 87 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project wire-android by wireapp.

the class BackgroundDrawable method setupOverlayAnimation.

private void setupOverlayAnimation() {
    overlayAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            float fraction = animation.getAnimatedFraction();
            float darknessRange = MAX_DARKNESS_OPACITY - MIN_DARKNESS_OPACITY;
            float radiusRage = MAX_RADIUS_FACTOR - MIN_RADIUS_FACTOR;
            float colorOpacityRange = RESTING_COLOR_OPACITY - MIN_COLOR_OPACITY;
            if (isOverlayVisible) {
                //animating on
                darknessOpacity = MIN_DARKNESS_OPACITY + darknessRange * fraction;
                vignetteRadiusFactor = MAX_RADIUS_FACTOR - radiusRage * fraction;
                accentColorOpacity = MIN_COLOR_OPACITY + colorOpacityRange * fraction;
            } else {
                //animating off
                darknessOpacity = MAX_DARKNESS_OPACITY - darknessRange * fraction;
                vignetteRadiusFactor = MIN_RADIUS_FACTOR + radiusRage * fraction;
                accentColorOpacity = RESTING_COLOR_OPACITY - colorOpacityRange * fraction;
            }
            updateFilter();
        }
    });
    overlayAnimation.setInterpolator(new AccelerateInterpolator());
    overlayAnimation.setDuration(OVERLAY_ANIMATION_DURATION);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 88 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator 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 89 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project Lightning-Browser by anthonycr.

the class VerticalItemAnimator method animateRemoveImpl.

private void animateRemoveImpl(final ViewHolder holder) {
    final View view = holder.itemView;
    final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
    mRemoveAnimations.add(holder);
    animation.setDuration(getRemoveDuration()).alpha(0).translationX(-holder.itemView.getWidth() / 2).setInterpolator(new AccelerateInterpolator()).setListener(new VpaListenerAdapter() {

        @Override
        public void onAnimationStart(View view) {
            dispatchRemoveStarting(holder);
        }

        @Override
        public void onAnimationEnd(View view) {
            animation.setListener(null);
            ViewCompat.setAlpha(view, 1);
            ViewCompat.setTranslationX(view, 0);
            dispatchRemoveFinished(holder);
            mRemoveAnimations.remove(holder);
            dispatchFinishedWhenDone();
        }
    }).start();
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 90 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project PreviewSeekBar by rubensousa.

the class PreviewAnimatorLollipopImpl method startUnreveal.

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void startUnreveal() {
    Animator animator = ViewAnimationUtils.createCircularReveal(previewView, getCenterX(previewView), getCenterY(previewView), getRadius(previewView), morphView.getWidth() * 2);
    animator.setTarget(previewView);
    animator.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            previewView.animate().setListener(null);
            frameView.setVisibility(View.INVISIBLE);
            previewView.setVisibility(View.INVISIBLE);
            morphView.setVisibility(View.VISIBLE);
            morphView.animate().y(getHideY()).scaleY(0.5f).scaleX(0.5f).setDuration(UNMORPH_MOVE_DURATION).setInterpolator(new AccelerateInterpolator()).setListener(hideListener);
        }
    });
    frameView.animate().alpha(1f).setDuration(UNMORPH_UNREVEAL_DURATION).setInterpolator(new AccelerateInterpolator());
    animator.setDuration(UNMORPH_UNREVEAL_DURATION).setInterpolator(new AccelerateInterpolator());
    animator.start();
}
Also used : Animator(android.animation.Animator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) TargetApi(android.annotation.TargetApi)

Aggregations

AccelerateInterpolator (android.view.animation.AccelerateInterpolator)186 Animator (android.animation.Animator)62 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)54 View (android.view.View)52 ObjectAnimator (android.animation.ObjectAnimator)41 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)40 ImageView (android.widget.ImageView)26 AnimatorSet (android.animation.AnimatorSet)24 TextView (android.widget.TextView)23 Animation (android.view.animation.Animation)21 ValueAnimator (android.animation.ValueAnimator)17 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)14 LinearInterpolator (android.view.animation.LinearInterpolator)14 TranslateAnimation (android.view.animation.TranslateAnimation)14 OvershootInterpolator (android.view.animation.OvershootInterpolator)13 Point (android.graphics.Point)12 Paint (android.graphics.Paint)10 Interpolator (android.view.animation.Interpolator)9 AlphaAnimation (android.view.animation.AlphaAnimation)8 AnticipateOvershootInterpolator (android.view.animation.AnticipateOvershootInterpolator)8