Search in sources :

Example 11 with FastOutSlowInInterpolator

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

the class FragmentThreadList method showLayoutActions.

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

            @Override
            public void onAnimationStart(View view) {
                if (finalIndex == 0) {
                    buttonExpandActions.setImageResource(android.R.color.transparent);
                }
            }

            @Override
            public void onAnimationEnd(View view) {
            }

            @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)

Example 12 with FastOutSlowInInterpolator

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

the class FragmentComments 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) RecyclerView(android.support.v7.widget.RecyclerView)

Example 13 with FastOutSlowInInterpolator

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

the class MainActivity method executeCirclesDropDown.

private void executeCirclesDropDown() {
    final int length = circlesLine.getChildCount();
    Animator[] animators = new Animator[length];
    for (int i = 0; i < length; i++) {
        View target = circlesLine.getChildAt(i);
        final float x0 = -10 * i;
        final float y0 = -10 * i;
        target.setTranslationX(x0);
        target.setTranslationY(y0);
        AnimatorPath path = new AnimatorPath();
        path.moveTo(x0, y0);
        path.curveTo(x0, y0, 0, y0, 0, 0);
        PathPoint[] points = new PathPoint[path.getPoints().size()];
        path.getPoints().toArray(points);
        AnimatorSet set = new AnimatorSet();
        set.play(ObjectAnimator.ofObject(target, PATH_POINT, new PathEvaluator(), points)).with(ObjectAnimator.ofFloat(target, View.ALPHA, (length - i) * 0.1f + 0.6f, 1f));
        animators[i] = set;
        animators[i].setStartDelay(15 * i);
    }
    AnimatorSet set = new AnimatorSet();
    set.playTogether(animators);
    set.setInterpolator(new FastOutSlowInInterpolator());
    set.setDuration(FAST_DURATION);
    set.start();
}
Also used : Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) AnimatorSet(android.animation.AnimatorSet) BindView(butterknife.BindView) View(android.view.View) CardView(android.support.v7.widget.CardView)

Example 14 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 15 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Douya by DreaminginCodeZH.

the class AppBarWrapperLayout method show.

public void show() {
    if (mShowing) {
        return;
    }
    mShowing = true;
    cancelAnimator();
    mAnimator = new AnimatorSet().setDuration(mAnimationDuration);
    mAnimator.setInterpolator(new FastOutSlowInInterpolator());
    AnimatorSet.Builder builder = mAnimator.play(ObjectAnimator.ofFloat(this, TRANSLATION_Y, getTranslationY(), 0));
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        builder.with(ObjectAnimator.ofFloat(mShadowCompatView, ALPHA, mShadowCompatView.getAlpha(), 1));
    } else {
        builder.with(ObjectAnimator.ofFloat(mAppbarView, TRANSLATION_Z, mAppbarView.getTranslationZ(), 0));
    }
    mAnimator.start();
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) AnimatorSet(android.animation.AnimatorSet)

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