List of usage examples for android.view.animation OvershootInterpolator OvershootInterpolator
public OvershootInterpolator(float tension)
From source file:Main.java
public static OvershootInterpolator getOvershootInterpolator(float tension) { return new OvershootInterpolator(tension); }
From source file:Main.java
public static AnimationSet startInfoAnimation(int AnimationType, float fromX, float toX, float fromY, float toY, float scaleX, float scaleToX, float scaleY, float scaleToY, float pinX, float pinY) { OvershootInterpolator overshootInterpolator = new OvershootInterpolator(2f); AnimationSet animationSet = new AnimationSet(true); TranslateAnimation translateAnimation = new TranslateAnimation(AnimationType, fromX, AnimationType, toX, AnimationType, fromY, AnimationType, toY); ScaleAnimation scaleAnimation = new ScaleAnimation(scaleX, scaleToX, scaleY, scaleToY, AnimationType, pinX, AnimationType, pinY);//from ww w .ja va 2 s. com animationSet.addAnimation(translateAnimation); animationSet.addAnimation(scaleAnimation); animationSet.setDuration(300); animationSet.setFillAfter(true); animationSet.setInterpolator(overshootInterpolator); return animationSet; }
From source file:Main.java
public static List<Animation> initAnimation(int AnimationType, float fromAlpha, float toAlpha, float fromDegress, float toDegress, float pinX, float pinY) { List<Animation> animations = new ArrayList<>(); AlphaAnimation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha); alphaAnimation.setDuration(300);/*from ww w .j ava 2 s . co m*/ AlphaAnimation exit_alphaAnimation = new AlphaAnimation(toAlpha, fromAlpha); exit_alphaAnimation.setDuration(300); OvershootInterpolator overshootInterpolator = new OvershootInterpolator(3.5f); RotateAnimation rotateAnimation = new RotateAnimation(fromDegress, toDegress, AnimationType, pinX, AnimationType, pinY); rotateAnimation.setDuration(300); rotateAnimation.setInterpolator(overshootInterpolator); rotateAnimation.setFillAfter(true); RotateAnimation exit_rotateAnimation = new RotateAnimation(toDegress, fromAlpha, AnimationType, pinX, AnimationType, pinY); exit_rotateAnimation.setDuration(300); exit_rotateAnimation.setInterpolator(overshootInterpolator); exit_rotateAnimation.setFillAfter(true); animations.add(alphaAnimation); animations.add(exit_alphaAnimation); animations.add(rotateAnimation); animations.add(exit_rotateAnimation); return animations; }
From source file:Main.java
public static void postAnimation(final View childLayout, int delay, final int duration) { int visibility = childLayout.getVisibility(); if (visibility != View.VISIBLE) { return;/*from ww w . j av a 2s .com*/ } childLayout.setVisibility(View.INVISIBLE); childLayout.postDelayed(new Runnable() { @Override public void run() { childLayout.setVisibility(View.VISIBLE); AnimationSet animationSet = new AnimationSet(true); animationSet.setDuration(duration); animationSet.setInterpolator(new OvershootInterpolator(0.8f)); int pivotXType = Animation.RELATIVE_TO_SELF; animationSet.addAnimation( new TranslateAnimation(pivotXType, -1, pivotXType, 0, pivotXType, 0, pivotXType, 0)); animationSet.addAnimation(new AlphaAnimation(0, 1)); childLayout.startAnimation(animationSet); } }, delay); }
From source file:com.github.rubensousa.stackview.animator.StackDefaultAnimator.java
@Override public void animateAdd(View view) { ViewCompat.setScaleY(view, 0.7f);/*from w w w .j ava 2 s. c o m*/ ViewCompat.animate(view).scaleY(1f).scaleX( 1 - getStackView().getCurrentSize() * getStackView().getScaleXFactor() < StackView.SCALE_X_MIN ? StackView.SCALE_X_MIN : 1 - getStackView().getCurrentSize() * getStackView().getScaleXFactor()) .translationY((getStackView().getCurrentSize() * getStackView().getVerticalSpacing())) .rotation(getStackView().nextRotation()).setStartDelay(getStackView().getCurrentSize() * 80) .setDuration(getAnimationDuration()).setInterpolator(new OvershootInterpolator(0.3f)); }
From source file:android.room.play.com.nasadaily.animators.OvershootInRightAnimator.java
@Override protected void animateAddImpl(final RecyclerView.ViewHolder holder) { ViewCompat.animate(holder.itemView).translationX(0).setDuration(getAddDuration()) .setInterpolator(new OvershootInterpolator(mTension)).setListener(new DefaultAddVpaListener(holder)) .start();/* w ww. j a v a2 s . c o m*/ }
From source file:android.room.play.com.nasadaily.animators.OvershootInLeftAnimator.java
@Override protected void animateAddImpl(final RecyclerView.ViewHolder holder) { ViewCompat.animate(holder.itemView).translationX(0).setDuration(getAddDuration()) .setListener(new DefaultAddVpaListener(holder)).setInterpolator(new OvershootInterpolator(mTension)) .start();/*from w w w . j a v a 2 s . c o m*/ }
From source file:com.angcyo.uiview.recycler.recyclerview.animators.OvershootInRightAnimator.java
@Override protected void animateAddImpl(final RecyclerView.ViewHolder holder) { ViewCompat.animate(holder.itemView).translationX(0).setDuration(getAddDuration()) .setInterpolator(new OvershootInterpolator(mTension)).setListener(new DefaultAddVpaListener(holder)) .setStartDelay(getAddDelay(holder)).start(); }
From source file:com.angcyo.uiview.recycler.recyclerview.animators.OvershootInLeftAnimator.java
@Override protected void animateAddImpl(final RecyclerView.ViewHolder holder) { ViewCompat.animate(holder.itemView).translationX(0).setDuration(getAddDuration()) .setListener(new DefaultAddVpaListener(holder)).setInterpolator(new OvershootInterpolator(mTension)) .setStartDelay(getAddDelay(holder)).start(); }
From source file:eu.davidea.samples.flexibleadapter.animators.OvershootInRightAnimator.java
@Override protected void animateAddImpl(final RecyclerView.ViewHolder holder, final int index) { ViewCompat.animate(holder.itemView).translationX(0).setDuration(getAddDuration()) .setInterpolator(new OvershootInterpolator(mTension)).setListener(new DefaultAddVpaListener(holder)) .start();/*from ww w. j a v a 2s . c o m*/ }