Search in sources :

Example 26 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Signal-Android by WhisperSystems.

the class ViewUtil method getAlphaAnimation.

private static Animation getAlphaAnimation(float from, float to, int duration) {
    final Animation anim = new AlphaAnimation(from, to);
    anim.setInterpolator(new FastOutSlowInInterpolator());
    anim.setDuration(duration);
    return anim;
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 27 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Signal-Android by WhisperSystems.

the class InviteActivity method loadAnimation.

private Animation loadAnimation(@AnimRes int animResId) {
    final Animation animation = AnimationUtils.loadAnimation(this, animResId);
    animation.setInterpolator(new FastOutSlowInInterpolator());
    return animation;
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) Animation(android.view.animation.Animation)

Example 28 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project CircularReveal by ozodrukh.

the class MainActivity method resetUi.

@OnClick(R.id.reset)
void resetUi(View resetCard) {
    cardsLine.setVisibility(View.INVISIBLE);
    final View target = ButterKnife.findById(this, R.id.activator);
    // Coordinates of circle initial point
    final ViewGroup parent = (ViewGroup) activatorMask.getParent();
    final Rect bounds = new Rect();
    final Rect maskBounds = new Rect();
    target.getDrawingRect(bounds);
    activatorMask.getDrawingRect(maskBounds);
    parent.offsetDescendantRectToMyCoords(target, bounds);
    parent.offsetDescendantRectToMyCoords(activatorMask, maskBounds);
    maskElevation = activatorMask.getCardElevation();
    activatorMask.setCardElevation(0);
    final int cX = maskBounds.centerX();
    final int cY = maskBounds.centerY();
    final Animator circularReveal = ViewAnimationUtils.createCircularReveal(activatorMask, cX, cY, (float) Math.hypot(maskBounds.width() * .5f, maskBounds.height() * .5f), target.getWidth() / 2f, View.LAYER_TYPE_HARDWARE);
    final float c0X = bounds.centerX() - maskBounds.centerX();
    final float c0Y = bounds.centerY() - maskBounds.centerY();
    AnimatorPath path = new AnimatorPath();
    path.moveTo(0, 0);
    path.curveTo(0, 0, 0, c0Y, c0X, c0Y);
    ObjectAnimator pathAnimator = ObjectAnimator.ofObject(this, "maskLocation", new PathEvaluator(), path.getPoints().toArray());
    AnimatorSet set = new AnimatorSet();
    set.playTogether(circularReveal, pathAnimator);
    set.setInterpolator(new FastOutSlowInInterpolator());
    set.setDuration(SLOW_DURATION);
    set.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            activatorMask.setCardElevation(maskElevation);
            activatorMask.setVisibility(View.INVISIBLE);
            circlesLine.setVisibility(View.VISIBLE);
            executeCirclesDropDown();
            target.setEnabled(true);
        }
    });
    set.start();
}
Also used : Rect(android.graphics.Rect) RevealViewGroup(io.codetail.animation.RevealViewGroup) ViewGroup(android.view.ViewGroup) ObjectAnimator(android.animation.ObjectAnimator) AnimatorSet(android.animation.AnimatorSet) BindView(butterknife.BindView) View(android.view.View) CardView(android.support.v7.widget.CardView) Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) OnClick(butterknife.OnClick)

Example 29 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project CircularReveal by ozodrukh.

the class MainActivity method activateAwareMotion.

@OnClick(R.id.activator)
void activateAwareMotion(View target) {
    // Cancel all concurrent events on view
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        target.cancelPendingInputEvents();
    }
    target.setEnabled(false);
    // Coordinates of circle initial point
    final ViewGroup parent = (ViewGroup) activatorMask.getParent();
    final Rect bounds = new Rect();
    final Rect maskBounds = new Rect();
    target.getDrawingRect(bounds);
    activatorMask.getDrawingRect(maskBounds);
    parent.offsetDescendantRectToMyCoords(target, bounds);
    parent.offsetDescendantRectToMyCoords(activatorMask, maskBounds);
    // Put Mask view at circle 8initial points
    maskElevation = activatorMask.getCardElevation();
    activatorMask.setCardElevation(0);
    activatorMask.setVisibility(View.VISIBLE);
    activatorMask.setX(bounds.left - maskBounds.centerX());
    activatorMask.setY(bounds.top - maskBounds.centerY());
    circlesLine.setVisibility(View.INVISIBLE);
    final int cX = maskBounds.centerX();
    final int cY = maskBounds.centerY();
    final float endRadius = (float) Math.hypot(maskBounds.width() * .5f, maskBounds.height() * .5f);
    Animator circularReveal = ViewAnimationUtils.createCircularReveal(activatorMask, cX, cY, target.getWidth() / 2, endRadius, View.LAYER_TYPE_HARDWARE);
    final float c0X = bounds.centerX() - maskBounds.centerX();
    final float c0Y = bounds.centerY() - maskBounds.centerY();
    AnimatorPath path = new AnimatorPath();
    path.moveTo(c0X, c0Y);
    path.curveTo(c0X, c0Y, 0, c0Y, 0, 0);
    ObjectAnimator pathAnimator = ObjectAnimator.ofObject(this, "maskLocation", new PathEvaluator(), path.getPoints().toArray());
    AnimatorSet set = new AnimatorSet();
    set.playTogether(circularReveal, pathAnimator);
    set.setInterpolator(new FastOutSlowInInterpolator());
    set.setDuration(SLOW_DURATION);
    set.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            executeCardsSequentialAnimation();
            activatorMask.setCardElevation(maskElevation);
        }
    });
    set.start();
}
Also used : Rect(android.graphics.Rect) Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) RevealViewGroup(io.codetail.animation.RevealViewGroup) ViewGroup(android.view.ViewGroup) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) AnimatorSet(android.animation.AnimatorSet) OnClick(butterknife.OnClick)

Example 30 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project PreLollipopTransition by takahirom.

the class EndFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_end, container, false);
    final ExitFragmentTransition exitFragmentTransition = FragmentTransition.with(this).interpolator(new LinearOutSlowInInterpolator()).to(v.findViewById(R.id.fragment_imageView)).start(savedInstanceState);
    exitFragmentTransition.exitListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationStart(Animator animation) {
            Log.d("TAG", "onAnimationStart: ");
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            Log.d("TAG", "onAnimationEnd: ");
        }
    }).interpolator(new FastOutSlowInInterpolator());
    exitFragmentTransition.startExitListening();
    return v;
}
Also used : LinearOutSlowInInterpolator(android.support.v4.view.animation.LinearOutSlowInInterpolator) Animator(android.animation.Animator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) View(android.view.View) ExitFragmentTransition(com.kogitune.activity_transition.fragment.ExitFragmentTransition)

Aggregations

FastOutSlowInInterpolator (android.support.v4.view.animation.FastOutSlowInInterpolator)35 View (android.view.View)11 Animator (android.animation.Animator)8 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)6 AnimatorSet (android.animation.AnimatorSet)6 ObjectAnimator (android.animation.ObjectAnimator)6 BindView (butterknife.BindView)6 PropertyValuesHolder (android.animation.PropertyValuesHolder)4 ViewPropertyAnimatorListener (android.support.v4.view.ViewPropertyAnimatorListener)4 RecyclerView (android.support.v7.widget.RecyclerView)4 MotionEvent (android.view.MotionEvent)3 ViewGroup (android.view.ViewGroup)3 TextView (android.widget.TextView)3 ExitFragmentTransition (com.kogitune.activity_transition.fragment.ExitFragmentTransition)3 IEndListener (su.levenetc.android.textsurface.interfaces.IEndListener)3 ISurfaceAnimation (su.levenetc.android.textsurface.interfaces.ISurfaceAnimation)3 TargetApi (android.annotation.TargetApi)2 Rect (android.graphics.Rect)2 Nullable (android.support.annotation.Nullable)2 LinearOutSlowInInterpolator (android.support.v4.view.animation.LinearOutSlowInInterpolator)2