Search in sources :

Example 96 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project ViewAnimator by florent37.

the class ViewAnimatorMainActivity method animateSequentially.

protected void animateSequentially() {
    ViewAnimator.animate(image).dp().width(100f, 150f).alpha(1, 0.1f).interpolator(new DecelerateInterpolator()).duration(800).thenAnimate(image).dp().width(150f, 100f).alpha(0.1f, 1f).interpolator(new AccelerateInterpolator()).duration(1200).start();
    ViewAnimator.animate(image).scaleX(0, 1).scaleY(0, 1).alpha(0, 1).decelerate().duration(500).thenAnimate(image).scaleX(1, 0).scaleY(1, 0).alpha(1, 0).accelerate().duration(500);
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator)

Example 97 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project WilliamChart by diogobernardino.

the class StackedCardThree method dismiss.

@Override
public void dismiss(Runnable action) {
    super.dismiss(action);
    mChart.dismiss(mChart.getChartAnimation().setInterpolator(new AccelerateInterpolator()).withEndAction(action));
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator)

Example 98 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project WilliamChart by diogobernardino.

the class StackedCardTwo method dismiss.

@Override
public void dismiss(Runnable action) {
    super.dismiss(action);
    mChart.dismiss(new Animation().setDuration(2500).setInterpolator(new AccelerateInterpolator()).withEndAction(action));
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) Animation(com.db.chart.animation.Animation)

Example 99 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project WilliamChart by diogobernardino.

the class StackedCardTwo method show.

@Override
public void show(Runnable action) {
    super.show(action);
    BarSet barSet = new BarSet(mLabels, mValues[0]);
    barSet.setColor(Color.parseColor("#90ee7e"));
    mChart.addData(barSet);
    barSet = new BarSet(mLabels, mValues[1]);
    barSet.setColor(Color.parseColor("#2b908f"));
    mChart.addData(barSet);
    Paint gridPaint = new Paint();
    gridPaint.setColor(Color.parseColor("#e7e7e7"));
    gridPaint.setStyle(Paint.Style.STROKE);
    gridPaint.setAntiAlias(true);
    gridPaint.setStrokeWidth(Tools.fromDpToPx(.7f));
    mChart.setStep(1).setGrid(0, 10, gridPaint).setLabelsFormat(new DecimalFormat("##'M'")).show(new Animation().setDuration(2500).setInterpolator(new AccelerateInterpolator()).withEndAction(action));
}
Also used : BarSet(com.db.chart.model.BarSet) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) DecimalFormat(java.text.DecimalFormat) Animation(com.db.chart.animation.Animation) Paint(android.graphics.Paint)

Example 100 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project platform_packages_apps_launcher by android.

the class DeleteZone method createAnimations.

private void createAnimations() {
    if (mInAnimation == null) {
        mInAnimation = new FastAnimationSet();
        final AnimationSet animationSet = mInAnimation;
        animationSet.setInterpolator(new AccelerateInterpolator());
        animationSet.addAnimation(new AlphaAnimation(0.0f, 1.0f));
        if (mOrientation == ORIENTATION_HORIZONTAL) {
            animationSet.addAnimation(new TranslateAnimation(Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f, Animation.RELATIVE_TO_SELF, 0.0f));
        } else {
            animationSet.addAnimation(new TranslateAnimation(Animation.RELATIVE_TO_SELF, 1.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f));
        }
        animationSet.setDuration(ANIMATION_DURATION);
    }
    if (mHandleInAnimation == null) {
        if (mOrientation == ORIENTATION_HORIZONTAL) {
            mHandleInAnimation = new TranslateAnimation(Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
        } else {
            mHandleInAnimation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 1.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f);
        }
        mHandleInAnimation.setDuration(ANIMATION_DURATION);
    }
    if (mOutAnimation == null) {
        mOutAnimation = new FastAnimationSet();
        final AnimationSet animationSet = mOutAnimation;
        animationSet.setInterpolator(new AccelerateInterpolator());
        animationSet.addAnimation(new AlphaAnimation(1.0f, 0.0f));
        if (mOrientation == ORIENTATION_HORIZONTAL) {
            animationSet.addAnimation(new FastTranslateAnimation(Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f));
        } else {
            animationSet.addAnimation(new FastTranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f, Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f));
        }
        animationSet.setDuration(ANIMATION_DURATION);
    }
    if (mHandleOutAnimation == null) {
        if (mOrientation == ORIENTATION_HORIZONTAL) {
            mHandleOutAnimation = new FastTranslateAnimation(Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f);
        } else {
            mHandleOutAnimation = new FastTranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 1.0f, Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f);
        }
        mHandleOutAnimation.setFillAfter(true);
        mHandleOutAnimation.setDuration(ANIMATION_DURATION);
    }
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) TranslateAnimation(android.view.animation.TranslateAnimation) AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation)

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