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;
}
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);
}
});
}
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());
}
}
}
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();
}
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();
}
Aggregations