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

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

Introduction

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

Prototype

public FastOutSlowInInterpolator() 

Source Link

Usage

From source file:com.wanderingcan.floatingactionmenu.FloatingActionMenu.java

/**
 * Sets the menu Close Animation for all the Floating Action Buttons that are part of the Floating
 * Action Menu/*from   w  w  w  .  j  a v  a  2  s . c o  m*/
 * @param resId the Resource Id of the Animation Resource
 */
public void setMenuCloseAnimation(@AnimRes int resId) {
    mMenuHideAnimation = resId;
    for (int i = mButtonsCount - 1; i >= 0; i--) {
        final View child = getChildAt(i);
        if (child != mMenuButton) {
            Animation hideAnimation = AnimationUtils.loadAnimation(getContext(), mMenuHideAnimation);
            if (mMenuHideAnimation == R.anim.fab_in) {
                hideAnimation.setInterpolator(new FastOutSlowInInterpolator());
            }

            ((FloatingActionButton) child).setHideAnimation(hideAnimation, mAnimationDuration);
        }
    }
}

From source file:com.rks.musicx.misc.utils.Helper.java

/**
 * Rotate view 360//w w  w.  j a va 2  s.  com
 * @param view
 */
public static void rotateFab(@NonNull View view) {
    ViewCompat.animate(view).rotation(360f).withLayer().setDuration(300)
            .setInterpolator(new FastOutSlowInInterpolator()).start();
}

From source file:org.xjy.android.nova.widget.ColorTabLayout.java

private void animateToTab(int newPosition) {
    if (newPosition == Tab.INVALID_POSITION) {
        return;/*from   w  w  w.j a va  2s. c  o  m*/
    }

    if (getWindowToken() == null || !ViewCompat.isLaidOut(this) || mTabStrip.childrenNeedLayout()) {
        // If we don't have a window token, or we haven't been laid out yet just draw the new
        // position now
        setScrollPosition(newPosition, 0f, true);
        return;
    }

    final int startScrollX = getScrollX();
    final int targetScrollX = calculateScrollXForTab(newPosition, 0);

    if (startScrollX != targetScrollX) {
        if (mScrollAnimator == null) {
            mScrollAnimator = new ValueAnimator();
            mScrollAnimator.setInterpolator(new FastOutSlowInInterpolator());
            mScrollAnimator.setDuration(ANIMATION_DURATION);
            mScrollAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public void onAnimationUpdate(ValueAnimator animation) {
                    scrollTo((Integer) animation.getAnimatedValue(), 0);
                }
            });
        }

        mScrollAnimator.setIntValues(startScrollX, targetScrollX);
        mScrollAnimator.start();
    }

    // Now animate the indicator
    mTabStrip.animateIndicatorToPosition(newPosition, ANIMATION_DURATION);
}

From source file:me.ccrama.redditslide.Views.SubsamplingScaleImageView.java

/**
 * Called by worker task when decoder is ready and image size and EXIF orientation is known.
 *///from   ww w. j  ava2s  .c o m
private synchronized void onTilesInited(ImageRegionDecoder decoder, int sWidth, int sHeight, int sOrientation) {
    // If actual dimensions don't match the declared size, reset everything.
    if (this.sWidth > 0 && this.sHeight > 0 && (this.sWidth != sWidth || this.sHeight != sHeight)) {
        reset(false);
        if (bitmap != null) {
            if (!bitmapIsCached) {
                bitmap.recycle();
            }
            bitmap = null;
            bitmapIsPreview = false;
            bitmapIsCached = false;
        }
    }
    this.decoder = decoder;
    this.sWidth = sWidth;
    this.sHeight = sHeight;
    this.sOrientation = sOrientation;
    checkReady();
    checkImageLoaded();
    invalidate();
    requestLayout();
    animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1);
}

From source file:me.ccrama.redditslide.Views.SubsamplingScaleImageView.java

/**
 * Called by worker task when a tile has loaded. Redraws the view.
 *///from  w w  w  .  j  ava2  s .  c om
private synchronized void onTileLoaded() {
    checkReady();
    checkImageLoaded();
    if (isBaseLayerReady() && bitmap != null) {
        if (!bitmapIsCached) {
            bitmap.recycle();
        }
        bitmap = null;
        bitmapIsPreview = false;
        bitmapIsCached = false;
    }
    invalidate();
    animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1);
}

From source file:me.ccrama.redditslide.Views.SubsamplingScaleImageView.java

/**
 * Called by worker task when full size image bitmap is ready (tiling is disabled).
 */// ww  w.j  av  a 2  s  .c  om
private synchronized void onImageLoaded(Bitmap bitmap, int sOrientation, boolean bitmapIsCached) {
    // If actual dimensions don't match the declared size, reset everything.
    if (this.sWidth > 0 && this.sHeight > 0
            && (this.sWidth != bitmap.getWidth() || this.sHeight != bitmap.getHeight())) {
        reset(false);
    }
    if (this.bitmap != null && !this.bitmapIsCached) {
        this.bitmap.recycle();
    }
    this.bitmapIsPreview = false;
    this.bitmapIsCached = bitmapIsCached;
    this.bitmap = bitmap;
    this.sWidth = bitmap.getWidth();
    this.sHeight = bitmap.getHeight();
    this.sOrientation = sOrientation;
    boolean ready = checkReady();
    boolean imageLoaded = checkImageLoaded();
    if (ready || imageLoaded) {
        invalidate();
        requestLayout();
    }
    animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1);
}