Example usage for android.support.v4.view.animation FastOutLinearInInterpolator FastOutLinearInInterpolator

List of usage examples for android.support.v4.view.animation FastOutLinearInInterpolator FastOutLinearInInterpolator

Introduction

In this page you can find the example usage for android.support.v4.view.animation FastOutLinearInInterpolator FastOutLinearInInterpolator.

Prototype

public FastOutLinearInInterpolator() 

Source Link

Usage

From source file:is.hello.go99.example.AmplitudesFragment.java

private void cascadeDimAmplitudesFromCenterItem(@NonNull final AmplitudeAdapter.ViewHolder viewHolder) {
    final int childIndex = recyclerView.indexOfChild(viewHolder.itemView);
    if (childIndex == -1) {
        Log.w(getClass().getSimpleName(), "Child view is missing?!");
        return;/*from  ww w . j a  v  a 2s  .c o m*/
    }

    final AnimatorTemplate animatorTemplate = new AnimatorTemplate(Anime.DURATION_FAST,
            new FastOutLinearInInterpolator());
    getAnimatorContext().transaction(animatorTemplate, AnimatorContext.OPTIONS_DEFAULT,
            new AnimatorContext.TransactionConsumer() {
                @Override
                public void consume(@NonNull AnimatorContext.Transaction transaction) {
                    long delay = 0;
                    for (int i = childIndex - 1; i >= 0; i--) {
                        transaction.animatorFor(recyclerView.getChildAt(i)).withStartDelay(delay)
                                .alpha(TARGET_DIMMED_ALPHA);

                        delay += itemAnimator.getDelayStep();
                    }

                    transaction.animatorFor(viewHolder.itemView).alpha(1f);

                    delay = 0;
                    for (int i = childIndex + 1, count = recyclerView.getChildCount(); i < count; i++) {
                        transaction.animatorFor(recyclerView.getChildAt(i)).withStartDelay(delay)
                                .alpha(TARGET_DIMMED_ALPHA);

                        delay += itemAnimator.getDelayStep();
                    }

                    if (infoTooltipView != null) {
                        infoTooltipView.dismiss(true);
                    }

                    AmplitudesFragment.this.infoTooltipView = new InfoTooltipView(getActivity());
                    infoTooltipView.setText(
                            getString(R.string.amplitude_tooltip_fmt, viewHolder.getAmplitudeValue() * 100f));
                    infoTooltipView.setAnimatorContext(getAnimatorContext());
                    infoTooltipView.showAboveView(root, viewHolder.itemView, AmplitudesFragment.this);
                }
            }, new OnAnimationCompleted() {
                @Override
                public void onAnimationCompleted(boolean finished) {
                }
            });
}

From source file:com.google.samples.apps.topeka.activity.QuizActivity.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void prepareCircularReveal(View startView, FrameLayout targetView) {
    int centerX = (startView.getLeft() + startView.getRight()) / 2;
    // Subtract the start view's height to adjust for relative coordinates on screen.
    int centerY = (startView.getTop() + startView.getBottom()) / 2 - startView.getHeight();
    float endRadius = (float) Math.hypot(centerX, centerY);
    mCircularReveal = ViewAnimationUtils.createCircularReveal(targetView, centerX, centerY,
            startView.getWidth(), endRadius);
    mCircularReveal.setInterpolator(new FastOutLinearInInterpolator());

    mCircularReveal.addListener(new AnimatorListenerAdapter() {
        @Override//ww w .j a  va 2  s  .  c o m
        public void onAnimationEnd(Animator animation) {
            mIcon.setVisibility(View.GONE);
            mCircularReveal.removeListener(this);
        }
    });
    // Adding a color animation from the FAB's color to transparent creates a dissolve like
    // effect to the circular reveal.
    int accentColor = ContextCompat.getColor(this, mCategory.getTheme().getAccentColor());
    mColorChange = ObjectAnimator.ofInt(targetView, ViewUtils.FOREGROUND_COLOR, accentColor, Color.TRANSPARENT);
    mColorChange.setEvaluator(new ArgbEvaluator());
    mColorChange.setInterpolator(mInterpolator);
}

From source file:sg.fxl.topekaport.QuizActivity.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void prepareCircularReveal(View startView, FrameLayout targetView) {
    int centerX = (startView.getLeft() + startView.getRight()) / 2;
    // Subtract the start view's height to adjust for relative coordinates on screen.
    int centerY = (startView.getTop() + startView.getBottom()) / 2 - startView.getHeight();
    float endRadius = (float) Math.hypot((double) centerX, (double) centerY);
    circularReveal = ViewAnimationUtils.createCircularReveal(targetView, centerX, centerY, startView.getWidth(),
            endRadius);/*from w  w  w.j a  va2 s  .  c o m*/
    circularReveal.setInterpolator(new FastOutLinearInInterpolator());

    circularReveal.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            icon.setVisibility(View.GONE);
            circularReveal.removeListener(this);
        }
    });
    // Adding a color animation from the FAB's color to transparent creates a dissolve like
    // effect to the circular reveal.
    int accentColor = ContextCompat.getColor(this, quiz.getTheme().getAccentColor());
    colorChange = ObjectAnimator.ofInt(targetView, ViewUtils.FOREGROUND_COLOR, accentColor, Color.TRANSPARENT);
    colorChange.setEvaluator(new ArgbEvaluator());
    colorChange.setInterpolator(interpolator);
}

From source file:com.google.samples.apps.topeka.view.quiz.QuizActivity.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void prepareCircularReveal(View startView, FrameLayout targetView, int themeAccentColor) {
    int centerX = (startView.getLeft() + startView.getRight()) / 2;
    // Subtract the start view's height to adjust for relative coordinates on screen.
    int centerY = (startView.getTop() + startView.getBottom()) / 2 - startView.getHeight();
    float endRadius = (float) Math.hypot(centerX, centerY);
    mCircularReveal = ViewAnimationUtils.createCircularReveal(targetView, centerX, centerY,
            startView.getWidth(), endRadius);
    mCircularReveal.setInterpolator(new FastOutLinearInInterpolator());

    mCircularReveal.addListener(new AnimatorListenerAdapter() {
        @Override/*from   w  w w .java2s.c om*/
        public void onAnimationEnd(Animator animation) {
            mIcon.setVisibility(View.GONE);
            mCircularReveal.removeListener(this);
        }
    });
    // Adding a color animation from the FAB's color to transparent creates a dissolve like
    // effect to the circular reveal.
    mColorChange = ObjectAnimator.ofInt(targetView, ViewUtils.FOREGROUND_COLOR, themeAccentColor,
            Color.TRANSPARENT);
    mColorChange.setEvaluator(new ArgbEvaluator());
    mColorChange.setInterpolator(mInterpolator);
}

From source file:org.chromium.chrome.browser.payments.ui.EditorView.java

private void dismissDialog() {
    if (mDialogInOutAnimator != null || !isShowing())
        return;//from w  ww .  j  a v  a  2s .  c om

    removeTextChangedListenersAndInputFilters();

    Animator dropDown = ObjectAnimator.ofFloat(mLayout, View.TRANSLATION_Y, 0f, mLayout.getHeight());
    Animator fadeOut = ObjectAnimator.ofFloat(mLayout, View.ALPHA, mLayout.getAlpha(), 0f);
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playTogether(dropDown, fadeOut);

    mDialogInOutAnimator = animatorSet;
    mDialogInOutAnimator.setDuration(DIALOG_EXIT_ANIMATION_MS);
    mDialogInOutAnimator.setInterpolator(new FastOutLinearInInterpolator());
    mDialogInOutAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            mDialogInOutAnimator = null;
            dismiss();
        }
    });

    mDialogInOutAnimator.start();
}

From source file:com.achep.acdisplay.ui.widgets.CircleView.java

private void startAnimatorBy(float from, float to, int duration) {
    cancelAndClearAnimator();/*ww  w . ja  va2s  . c o  m*/
    // Animate the circle
    mAnimator = ObjectAnimator.ofFloat(this, RADIUS_PROPERTY, from, to);
    mAnimator.setInterpolator(new FastOutLinearInInterpolator());
    mAnimator.setDuration(duration);
    mAnimator.start();
}

From source file:io.github.yavski.fabspeeddial.FabSpeedDial.java

private void removeFabMenuItems() {
    if (touchGuard != null)
        touchGuard.setVisibility(GONE);/*from   ww  w. j  av  a  2  s .  c  o  m*/

    ViewCompat.animate(menuItemsLayout)
            .setDuration(getResources().getInteger(android.R.integer.config_shortAnimTime)).alpha(0f)
            .setInterpolator(new FastOutLinearInInterpolator())
            .setListener(new ViewPropertyAnimatorListenerAdapter() {
                @Override
                public void onAnimationStart(View view) {
                    super.onAnimationStart(view);
                    isAnimating = true;
                }

                @Override
                public void onAnimationEnd(View view) {
                    super.onAnimationEnd(view);
                    menuItemsLayout.removeAllViews();
                    isAnimating = false;
                }
            }).start();
}

From source file:android.support.v17.leanback.app.BackgroundManager.java

private BackgroundManager(Activity activity, boolean isSupportFragmentActivity) {
    mContext = activity;//from  ww w.j  a  v a  2  s  . com
    mService = BackgroundContinuityService.getInstance();
    mHeightPx = mContext.getResources().getDisplayMetrics().heightPixels;
    mWidthPx = mContext.getResources().getDisplayMetrics().widthPixels;
    mHandler = new Handler();

    Interpolator defaultInterpolator = new FastOutLinearInInterpolator();
    mAccelerateInterpolator = AnimationUtils.loadInterpolator(mContext, android.R.anim.accelerate_interpolator);
    mDecelerateInterpolator = AnimationUtils.loadInterpolator(mContext, android.R.anim.decelerate_interpolator);

    mAnimator = ValueAnimator.ofInt(0, FULL_ALPHA);
    mAnimator.addListener(mAnimationListener);
    mAnimator.addUpdateListener(mAnimationUpdateListener);
    mAnimator.setInterpolator(defaultInterpolator);

    mDimAnimator = new ValueAnimator();
    mDimAnimator.addUpdateListener(mDimUpdateListener);

    TypedArray ta = activity.getTheme().obtainStyledAttributes(new int[] { android.R.attr.windowBackground });
    mThemeDrawableResourceId = ta.getResourceId(0, -1);
    if (mThemeDrawableResourceId < 0) {
        if (DEBUG)
            Log.v(TAG, "BackgroundManager no window background resource!");
    }
    ta.recycle();

    if (isSupportFragmentActivity) {
        createSupportFragment((FragmentActivity) activity);
    } else {
        createFragment(activity);
    }
}