use of android.view.animation.OvershootInterpolator in project FlyRefresh by race604.
the class SampleItemAnimator method animateAddImpl.
@Override
protected void animateAddImpl(final RecyclerView.ViewHolder holder) {
View target = holder.itemView;
View icon = target.findViewById(R.id.icon);
Animator swing = ObjectAnimator.ofFloat(icon, "rotationX", 45, 0);
swing.setInterpolator(new OvershootInterpolator(5));
View right = holder.itemView.findViewById(R.id.right);
Animator rotateIn = ObjectAnimator.ofFloat(right, "rotationY", 90, 0);
rotateIn.setInterpolator(new DecelerateInterpolator());
AnimatorSet animator = new AnimatorSet();
animator.setDuration(getAddDuration());
animator.playTogether(swing, rotateIn);
animator.start();
}
use of android.view.animation.OvershootInterpolator in project cw-omnibus by commonsguy.
the class AsyncDemoFragment method changeMenuIconAnimation.
// based on https://goo.gl/3IUM8K
private void changeMenuIconAnimation(final FloatingActionMenu menu) {
AnimatorSet set = new AnimatorSet();
final ImageView v = menu.getMenuIconView();
ObjectAnimator scaleOutX = ObjectAnimator.ofFloat(v, "scaleX", 1.0f, 0.2f);
ObjectAnimator scaleOutY = ObjectAnimator.ofFloat(v, "scaleY", 1.0f, 0.2f);
ObjectAnimator scaleInX = ObjectAnimator.ofFloat(v, "scaleX", 0.2f, 1.0f);
ObjectAnimator scaleInY = ObjectAnimator.ofFloat(v, "scaleY", 0.2f, 1.0f);
scaleOutX.setDuration(50);
scaleOutY.setDuration(50);
scaleInX.setDuration(150);
scaleInY.setDuration(150);
scaleInX.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
v.setImageResource(menu.isOpened() ? R.drawable.ic_action_settings : R.drawable.ic_close);
}
});
set.play(scaleOutX).with(scaleOutY);
set.play(scaleInX).with(scaleInY).after(scaleOutX);
set.setInterpolator(new OvershootInterpolator(2));
menu.setIconToggleAnimatorSet(set);
}
use of android.view.animation.OvershootInterpolator in project ENViews by codeestX.
the class ENDownloadView method endAnim.
private void endAnim() {
ValueAnimator endAnim = ValueAnimator.ofFloat(1.f, 100.f);
endAnim.setDuration(700);
endAnim.setInterpolator(new OvershootInterpolator());
endAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
mFraction = valueAnimator.getAnimatedFraction();
invalidate();
}
});
endAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mFraction = 0;
mCurrentState = STATE_RESET;
if (onDownloadStateListener != null) {
onDownloadStateListener.onDownloadFinish();
}
}
});
endAnim.start();
}
use of android.view.animation.OvershootInterpolator in project KJFrameForAndroid by kymjs.
the class KJAnimations method openAnimation.
/**
* 打开的动画
*
* @param relativeLayout
* 子菜单容器
* @param background
* 子菜单背景
* @param menu
* 菜单按钮
* @param durationMillis
* 动画时间
*/
public static void openAnimation(RelativeLayout relativeLayout, ImageView menu, long durationMillis) {
relativeLayout.setVisibility(View.VISIBLE);
for (int i = 1; i < relativeLayout.getChildCount(); i++) {
ImageView imageView = null;
if (relativeLayout.getChildAt(i) instanceof ImageView) {
imageView = (ImageView) relativeLayout.getChildAt(i);
} else {
continue;
}
AnimationSet set = new AnimationSet(true);
set.addAnimation(getRotateAnimation(-360, 0, durationMillis));
set.addAnimation(getAlphaAnimation(0.5f, 1.0f, durationMillis));
set.addAnimation(getTranslateAnimation(menu.getLeft() - imageView.getLeft(), 0, menu.getTop() - imageView.getTop(), 0, durationMillis));
set.setFillAfter(true);
set.setDuration(durationMillis);
set.setStartOffset((i * 100) / (-1 + relativeLayout.getChildCount()));
set.setInterpolator(new OvershootInterpolator(1f));
imageView.startAnimation(set);
}
}
use of android.view.animation.OvershootInterpolator in project Signal-Android by WhisperSystems.
the class AttachmentTypeSelector method animateButtonIn.
private void animateButtonIn(View button, int delay) {
AnimationSet animation = new AnimationSet(true);
Animation scale = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.0f);
animation.addAnimation(scale);
animation.setInterpolator(new OvershootInterpolator(1));
animation.setDuration(ANIMATION_DURATION);
animation.setStartOffset(delay);
button.startAnimation(animation);
}
Aggregations