Search in sources :

Example 1 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project SmoothProgressBar by castorflex.

the class MakeCustomActivity method setInterpolator.

private void setInterpolator(int position) {
    switch(position) {
        case 1:
            mCurrentInterpolator = new LinearInterpolator();
            mSeekBarFactor.setEnabled(false);
            break;
        case 2:
            mCurrentInterpolator = new AccelerateDecelerateInterpolator();
            mSeekBarFactor.setEnabled(false);
            break;
        case 3:
            mCurrentInterpolator = new DecelerateInterpolator(mFactor);
            mSeekBarFactor.setEnabled(true);
            break;
        case 4:
            mCurrentInterpolator = new FastOutSlowInInterpolator();
            mSeekBarFactor.setEnabled(true);
            break;
        case 0:
        default:
            mCurrentInterpolator = new AccelerateInterpolator(mFactor);
            mSeekBarFactor.setEnabled(true);
            break;
    }
    mProgressBar.setSmoothProgressDrawableInterpolator(mCurrentInterpolator);
    mProgressBar.setSmoothProgressDrawableColors(getResources().getIntArray(R.array.gplus_colors));
    updateValues();
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) LinearInterpolator(android.view.animation.LinearInterpolator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator)

Example 2 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project UltimateAndroid by cymcsg.

the class RippleBackgroundActivity method foundDevice.

private void foundDevice() {
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.setDuration(400);
    animatorSet.setInterpolator(new AccelerateDecelerateInterpolator());
    ArrayList<Animator> animatorList = new ArrayList<Animator>();
    ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(foundDevice, "ScaleX", 0f, 1.2f, 1f);
    animatorList.add(scaleXAnimator);
    ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(foundDevice, "ScaleY", 0f, 1.2f, 1f);
    animatorList.add(scaleYAnimator);
    animatorSet.playTogether(animatorList);
    foundDevice.setVisibility(View.VISIBLE);
    animatorSet.start();
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) ArrayList(java.util.ArrayList) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) AnimatorSet(android.animation.AnimatorSet)

Example 3 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project ENViews by codeestX.

the class ENScrollView method select.

public void select() {
    if (mCurrentState == STATE_SELECT) {
        return;
    }
    mCurrentState = STATE_SELECT;
    ValueAnimator valueAnimator = ValueAnimator.ofObject(new ArgbEvaluator(), mBgLineColor, mLineColor);
    valueAnimator.setDuration(mDuration);
    valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            mFraction = valueAnimator.getAnimatedFraction();
            mCurrentColor = (int) valueAnimator.getAnimatedValue();
            invalidate();
        }
    });
    if (!valueAnimator.isRunning()) {
        valueAnimator.start();
    }
    valueAnimator.start();
}
Also used : ArgbEvaluator(android.animation.ArgbEvaluator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 4 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project ENViews by codeestX.

the class ENVolumeView method closeVolume.

private void closeVolume() {
    ValueAnimator valueAnimator = ValueAnimator.ofFloat(1.f, 100.f);
    valueAnimator.setDuration(800);
    valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            mFraction = 1 - valueAnimator.getAnimatedFraction();
            invalidate();
        }
    });
    if (!valueAnimator.isRunning()) {
        valueAnimator.start();
    }
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 5 with AccelerateDecelerateInterpolator

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

the class BarCardThree method show.

@Override
public void show(Runnable action) {
    super.show(action);
    Tooltip tip = new Tooltip(mContext);
    tip.setBackgroundColor(Color.parseColor("#CC7B1F"));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat(View.ALPHA, 1);
        tip.setEnterAnimation(alpha).setDuration(150);
        alpha = PropertyValuesHolder.ofFloat(View.ALPHA, 0);
        tip.setExitAnimation(alpha).setDuration(150);
    }
    mChart.setTooltips(tip);
    BarSet dataset = new BarSet(mLabels, mValues[0]);
    dataset.setColor(Color.parseColor("#eb993b"));
    mChart.addData(dataset);
    mChart.setBarSpacing(Tools.fromDpToPx(1.5f));
    mChart.setXLabels(AxisRenderer.LabelPosition.NONE).setYLabels(AxisRenderer.LabelPosition.NONE).setXAxis(false).setYAxis(false);
    Animation anim = new Animation().setEasing(new AccelerateDecelerateInterpolator()).setEndAction(action);
    mChart.show(anim);
}
Also used : BarSet(com.db.chart.model.BarSet) Tooltip(com.db.chart.tooltip.Tooltip) PropertyValuesHolder(android.animation.PropertyValuesHolder) Animation(com.db.chart.animation.Animation) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator)

Aggregations

AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)152 ObjectAnimator (android.animation.ObjectAnimator)30 ValueAnimator (android.animation.ValueAnimator)30 Animator (android.animation.Animator)28 View (android.view.View)28 AnimatorSet (android.animation.AnimatorSet)19 Animation (android.view.animation.Animation)19 Handler (android.os.Handler)14 TranslateAnimation (android.view.animation.TranslateAnimation)12 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)10 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)10 AlphaAnimation (android.view.animation.AlphaAnimation)10 ImageView (android.widget.ImageView)10 Paint (android.graphics.Paint)9 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)9 LinearInterpolator (android.view.animation.LinearInterpolator)9 ScaleAnimation (android.view.animation.ScaleAnimation)9 PropertyValuesHolder (android.animation.PropertyValuesHolder)8 TextView (android.widget.TextView)8 Point (android.graphics.Point)7