Search in sources :

Example 36 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project HTextView by hanks-zyh.

the class LineText method animateStart.

@Override
protected void animateStart(CharSequence text) {
    ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1).setDuration((long) ANIMA_DURATION);
    valueAnimator.setInterpolator(new DecelerateInterpolator());
    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            progress = (float) animation.getAnimatedValue();
            mHTextView.invalidate();
        }
    });
    valueAnimator.start();
    progress = 0;
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 37 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project InstaMaterial by frogermcs.

the class SendingProgressView method setupDoneAnimators.

private void setupDoneAnimators() {
    doneBgAnimator = ObjectAnimator.ofFloat(this, "currentDoneBgOffset", MAX_DONE_BG_OFFSET, 0).setDuration(300);
    doneBgAnimator.setInterpolator(new DecelerateInterpolator());
    checkmarkAnimator = ObjectAnimator.ofFloat(this, "currentCheckmarkOffset", MAX_DONE_IMG_OFFSET, 0).setDuration(300);
    checkmarkAnimator.setInterpolator(new OvershootInterpolator());
    checkmarkAnimator.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            changeState(STATE_FINISHED);
        }
    });
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) OvershootInterpolator(android.view.animation.OvershootInterpolator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter)

Example 38 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project cardslib by gabrielemariotti.

the class BaseActivity method onActionBarAutoShowOrHide.

protected void onActionBarAutoShowOrHide(boolean shown) {
    if (mStatusBarColorAnimator != null) {
        mStatusBarColorAnimator.cancel();
    }
    mStatusBarColorAnimator = ObjectAnimator.ofInt((mDrawerLayout != null) ? mDrawerLayout : mLPreviewUtils, (mDrawerLayout != null) ? "statusBarBackgroundColor" : "statusBarColor", shown ? Color.BLACK : mNormalStatusBarColor, shown ? mNormalStatusBarColor : Color.BLACK).setDuration(250);
    if (mDrawerLayout != null) {
        mStatusBarColorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                ViewCompat.postInvalidateOnAnimation(mDrawerLayout);
            }
        });
    }
    mStatusBarColorAnimator.setEvaluator(ARGB_EVALUATOR);
    mStatusBarColorAnimator.start();
    for (View view : mHideableHeaderViews) {
        if (shown) {
            view.animate().translationY(0).alpha(1).setDuration(HEADER_HIDE_ANIM_DURATION).setInterpolator(new DecelerateInterpolator());
        } else {
            view.animate().translationY(-view.getBottom()).alpha(0).setDuration(HEADER_HIDE_ANIM_DURATION).setInterpolator(new DecelerateInterpolator());
        }
    }
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 39 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project ZoomHeader by githubwing.

the class ZoomHeaderView method expand.

private void expand(float y) {
    mRecyclerView.scrollToPosition(0);
    ValueAnimator va = ValueAnimator.ofFloat(y, -getHeight() / 3);
    va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            float y = (float) animation.getAnimatedValue();
            mViewPager.canScroll = false;
            setTranslationY(y);
            isExpand = true;
        }
    });
    va.setInterpolator(new DecelerateInterpolator());
    va.setDuration(ANIMATE_LENGTH);
    va.start();
    //允许滑动
    ((CtrlLinearLayoutManager) mRecyclerView.getLayoutManager()).setScrollEnabled(true);
    //底部上移
    ValueAnimator bottomAnimate = ValueAnimator.ofFloat(mBottomView.getY(), mBottomY);
    bottomAnimate.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            mBottomView.setY((Float) animation.getAnimatedValue());
        }
    });
    bottomAnimate.start();
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 40 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project ZoomHeader by githubwing.

the class ZoomHeaderView method restore.

public void restore(float y) {
    mCloseTxt.setAlpha(0f);
    if (y > mFirstY) {
        ValueAnimator closeVa = ValueAnimator.ofFloat(1, 0);
        closeVa.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                mCloseTxt.setAlpha((Float) animation.getAnimatedValue());
            }
        });
        closeVa.setDuration(ANIMATE_LENGTH);
        closeVa.start();
    }
    mRecyclerView.scrollToPosition(0);
    ValueAnimator restoreVa = ValueAnimator.ofFloat(y, mFirstY);
    restoreVa.setInterpolator(new DecelerateInterpolator());
    restoreVa.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            float y = (float) animation.getAnimatedValue();
            setTranslationY(y);
            isExpand = false;
            mViewPager.canScroll = true;
        }
    });
    restoreVa.setDuration(ANIMATE_LENGTH);
    restoreVa.start();
    //禁止滑动
    ((CtrlLinearLayoutManager) mRecyclerView.getLayoutManager()).setScrollEnabled(false);
    //底部隐藏
    ValueAnimator bottomAnimate = ValueAnimator.ofFloat(mBottomView.getY(), mBottomY + mBottomView.getHeight());
    bottomAnimate.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            mBottomView.setY((Float) animation.getAnimatedValue());
        }
    });
    bottomAnimate.start();
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator)

Aggregations

DecelerateInterpolator (android.view.animation.DecelerateInterpolator)312 ObjectAnimator (android.animation.ObjectAnimator)80 Animator (android.animation.Animator)66 ValueAnimator (android.animation.ValueAnimator)59 View (android.view.View)58 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)55 AnimatorSet (android.animation.AnimatorSet)52 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)36 ImageView (android.widget.ImageView)32 AlphaAnimation (android.view.animation.AlphaAnimation)30 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)29 Animation (android.view.animation.Animation)21 TextView (android.widget.TextView)20 Point (android.graphics.Point)18 ValueAnimator (com.nineoldandroids.animation.ValueAnimator)18 Paint (android.graphics.Paint)14 LinearInterpolator (android.view.animation.LinearInterpolator)14 ScaleAnimation (android.view.animation.ScaleAnimation)14 AnimatorSet (com.actionbarsherlock.internal.nineoldandroids.animation.AnimatorSet)14 ObjectAnimator (com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator)14