use of android.view.animation.AccelerateDecelerateInterpolator in project ViewAnimator by florent37.
the class MainActivity method animateParallel.
protected void animateParallel() {
final ViewAnimator viewAnimator = ViewAnimator.animate(mountain, image).dp().translationY(-1000, 0).alpha(0, 1).singleInterpolator(new OvershootInterpolator()).andAnimate(percent).scale(0, 1).andAnimate(text).textColor(Color.BLACK, Color.WHITE).backgroundColor(Color.WHITE, Color.BLACK).waitForHeight().singleInterpolator(new AccelerateDecelerateInterpolator()).duration(2000).thenAnimate(percent).custom(new AnimationListener.Update<TextView>() {
@Override
public void update(TextView view, float value) {
view.setText(String.format(Locale.US, "%.02f%%", value));
}
}, 0, 1).andAnimate(image).rotation(0, 360).duration(5000).start();
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@Override
public void run() {
viewAnimator.cancel();
}
}, 3000);
}
use of android.view.animation.AccelerateDecelerateInterpolator in project HTextView by hanks-zyh.
the class FallText method animateStart.
@Override
protected void animateStart(CharSequence text) {
int n = mText.length();
n = n <= 0 ? 1 : n;
long duration = (long) (charTime + charTime / mostCount * (n - 1));
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, duration).setDuration(duration);
valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
progress = (float) animation.getAnimatedValue();
mHTextView.invalidate();
}
});
valueAnimator.start();
}
use of android.view.animation.AccelerateDecelerateInterpolator in project HTextView by hanks-zyh.
the class PixelateText method animateText.
@Override
public void animateText(CharSequence text) {
mOldText = mText;
mText = text;
calc();
int n = mText.length();
n = n <= 0 ? 1 : n;
long duration = (long) (charTime + charTime / mostCount * (n - 1));
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, duration).setDuration(duration);
valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
progress = (float) animation.getAnimatedValue();
mHTextView.invalidate();
}
});
valueAnimator.start();
}
use of android.view.animation.AccelerateDecelerateInterpolator in project FolderLayout by kyze8439690.
the class FolderLayout method playExpandItemAnimation.
private void playExpandItemAnimation(final View child) {
final LayoutParams p = (LayoutParams) child.getLayoutParams();
TranslateAnimation animation = new TranslateAnimation(0, 0, 0, p.shrinkTop - child.getTop());
animation.setInterpolator(new AccelerateDecelerateInterpolator());
animation.setDuration(mDuration);
animation.setFillAfter(true);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
child.offsetTopAndBottom(p.shrinkTop - child.getTop());
child.clearAnimation();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
child.startAnimation(animation);
}
use of android.view.animation.AccelerateDecelerateInterpolator in project Android-ObservableScrollView by ksoichiro.
the class FillGap3BaseActivity method changeHeaderBackgroundHeightAnimated.
private void changeHeaderBackgroundHeightAnimated(boolean shouldShowGap, boolean animated) {
if (mGapIsChanging) {
return;
}
final int heightOnGapShown = mHeaderBar.getHeight();
final int heightOnGapHidden = mHeaderBar.getHeight() + mActionBarSize;
final float from = mHeaderBackground.getLayoutParams().height;
final float to;
if (shouldShowGap) {
if (!mGapHidden) {
// Already shown
return;
}
to = heightOnGapShown;
} else {
if (mGapHidden) {
// Already hidden
return;
}
to = heightOnGapHidden;
}
if (animated) {
ViewPropertyAnimator.animate(mHeaderBackground).cancel();
ValueAnimator a = ValueAnimator.ofFloat(from, to);
a.setDuration(100);
a.setInterpolator(new AccelerateDecelerateInterpolator());
a.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float height = (float) animation.getAnimatedValue();
changeHeaderBackgroundHeight(height, to, heightOnGapHidden);
}
});
a.start();
} else {
changeHeaderBackgroundHeight(to, to, heightOnGapHidden);
}
}
Aggregations