Search in sources :

Example 1 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 2 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 3 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ColorPickerFragment method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case R.id.reset_color:
        case R.id.reset_color1:
            mColorPicker.setColor(mResetColor1, true);
            return true;
        case R.id.reset_color2:
            mColorPicker.setColor(mResetColor2, true);
            return true;
        case R.id.edit_hex:
            mEditHexValue.setText(ColorPickerPreference.convertToARGB(mNewColorValue));
            return true;
        case R.id.show_hide_favorites:
            mAnimationType = FAVORITES_VISIBILITY;
            mAnimator.setInterpolator(new FastOutSlowInInterpolator());
            mAnimator.setDuration(300);
            mAnimator.start();
            return true;
        case R.id.show_hide_help:
            mAnimationType = HELP_SCREEN_VISIBILITY;
            mAnimator.setInterpolator(new FastOutSlowInInterpolator());
            mAnimator.setDuration(mShowFavorites ? 195 : 225);
            mAnimator.start();
        default:
            return super.onOptionsItemSelected(item);
    }
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator)

Example 4 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Slide by ccrama.

the class MainActivity method slideAnimator.

private ValueAnimator slideAnimator(int start, int end, final View v) {
    ValueAnimator animator = ValueAnimator.ofInt(start, end);
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            // Update Height
            int value = (Integer) valueAnimator.getAnimatedValue();
            ViewGroup.LayoutParams layoutParams = v.getLayoutParams();
            layoutParams.height = value;
            v.setLayoutParams(layoutParams);
        }
    });
    return animator;
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) ValueAnimator(android.animation.ValueAnimator)

Example 5 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Slide by ccrama.

the class MediaView method fadeAnimator.

private static ValueAnimator fadeAnimator(float start, float end, final View v) {
    ValueAnimator animator = ValueAnimator.ofFloat(start, end);
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            // Update Height
            float value = (Float) valueAnimator.getAnimatedValue();
            v.setAlpha(value);
        }
    });
    return animator;
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) ValueAnimator(android.animation.ValueAnimator)

Aggregations

FastOutSlowInInterpolator (android.support.v4.view.animation.FastOutSlowInInterpolator)59 Animator (android.animation.Animator)22 ValueAnimator (android.animation.ValueAnimator)19 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)16 View (android.view.View)14 ObjectAnimator (android.animation.ObjectAnimator)12 AnimatorSet (android.animation.AnimatorSet)10 BindView (butterknife.BindView)8 RecyclerView (android.support.v7.widget.RecyclerView)5 TextView (android.widget.TextView)5 MaterialTapTargetPrompt (uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt)5 ViewPropertyAnimatorListener (android.support.v4.view.ViewPropertyAnimatorListener)4 LinearOutSlowInInterpolator (android.support.v4.view.animation.LinearOutSlowInInterpolator)4 ExitFragmentTransition (com.kogitune.activity_transition.fragment.ExitFragmentTransition)3 ValueAnimator (com.nineoldandroids.animation.ValueAnimator)3 ArgbEvaluator (android.animation.ArgbEvaluator)2 TargetApi (android.annotation.TargetApi)2 Rect (android.graphics.Rect)2 Handler (android.os.Handler)2 FastOutLinearInInterpolator (android.support.v4.view.animation.FastOutLinearInInterpolator)2