Search in sources :

Example 6 with FastOutSlowInInterpolator

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

the class QuickAttachmentDrawer method slideTo.

private void slideTo(int slideOffset, boolean forceInstant) {
    if (animator != null) {
        animator.cancel();
        animator = null;
    }
    if (!forceInstant) {
        animator = ObjectAnimator.ofInt(this, "slideOffset", this.slideOffset, slideOffset);
        animator.setInterpolator(new FastOutSlowInInterpolator());
        animator.setDuration(400);
        animator.start();
        ViewCompat.postInvalidateOnAnimation(this);
    } else {
        this.slideOffset = slideOffset;
        requestLayout();
        invalidate();
    }
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator)

Example 7 with FastOutSlowInInterpolator

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

the class HidingLinearLayout method animateWith.

private void animateWith(Animation animation) {
    animation.setDuration(150);
    animation.setInterpolator(new FastOutSlowInInterpolator());
    startAnimation(animation);
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator)

Example 8 with FastOutSlowInInterpolator

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

the class TransferControlView method getWidthAnimator.

private Animator getWidthAnimator(final int from, final int to) {
    final ValueAnimator anim = ValueAnimator.ofInt(from, to);
    anim.addUpdateListener(new AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            final int val = (Integer) animation.getAnimatedValue();
            final ViewGroup.LayoutParams layoutParams = getLayoutParams();
            layoutParams.width = val;
            setLayoutParams(layoutParams);
        }
    });
    anim.setInterpolator(new FastOutSlowInInterpolator());
    anim.setDuration(TRANSITION_MS);
    return anim;
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) AnimatorUpdateListener(com.nineoldandroids.animation.ValueAnimator.AnimatorUpdateListener) ValueAnimator(com.nineoldandroids.animation.ValueAnimator)

Example 9 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Reader by TheKeeperOfPie.

the class FragmentComments method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);
    fastOutSlowInInterpolator = new FastOutSlowInInterpolator();
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator)

Example 10 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Reader by TheKeeperOfPie.

the class FragmentThreadList method hideLayoutActions.

private void hideLayoutActions(long offset) {
    for (int index = 0; index < layoutActions.getChildCount(); index++) {
        final View view = layoutActions.getChildAt(index);
        view.setScaleX(1f);
        view.setScaleY(1f);
        view.setAlpha(1f);
        final int finalIndex = index;
        ViewCompat.animate(view).alpha(0f).scaleX(0f).scaleY(0f).setInterpolator(fastOutSlowInInterpolator).setDuration(DURATION_ACTIONS_FADE).setStartDelay((long) (index * offset * OFFSET_MODIFIER)).setListener(new ViewPropertyAnimatorListener() {

            @Override
            public void onAnimationStart(View view) {
            }

            @Override
            public void onAnimationEnd(View view) {
                view.setVisibility(View.GONE);
                if (finalIndex == layoutActions.getChildCount() - 1) {
                    buttonExpandActions.setImageResource(R.drawable.ic_unfold_more_white_24dp);
                    buttonExpandActions.setColorFilter(themer.getColorFilterAccent());
                }
            }

            @Override
            public void onAnimationCancel(View view) {
            }
        }).start();
    }
}
Also used : ViewPropertyAnimatorListener(android.support.v4.view.ViewPropertyAnimatorListener) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView)

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