Search in sources :

Example 91 with Transformation

use of android.view.animation.Transformation in project BookReader by JustWayward.

the class SwipeRefreshLayout method startScaleDownReturnToStartAnimation.

private void startScaleDownReturnToStartAnimation(int from, AnimationListener listener) {
    mFrom = from;
    if (isAlphaUsedForScale()) {
        mStartingScale = mProgress.getAlpha();
    } else {
        mStartingScale = ViewCompat.getScaleX(mCircleView);
    }
    mScaleDownToStartAnimation = new Animation() {

        @Override
        public void applyTransformation(float interpolatedTime, Transformation t) {
            float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
            setAnimationProgress(targetScale);
            moveToStart(interpolatedTime);
        }
    };
    mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
    if (listener != null) {
        mCircleView.setAnimationListener(listener);
    }
    mCircleView.clearAnimation();
    mCircleView.startAnimation(mScaleDownToStartAnimation);
}
Also used : Transformation(android.view.animation.Transformation) Animation(android.view.animation.Animation)

Example 92 with Transformation

use of android.view.animation.Transformation in project BookReader by JustWayward.

the class SwipeRefreshLayout method startAlphaAnimation.

private Animation startAlphaAnimation(final int startingAlpha, final int endingAlpha) {
    // show the trigger point.
    if (mScale && isAlphaUsedForScale()) {
        return null;
    }
    Animation alpha = new Animation() {

        @Override
        public void applyTransformation(float interpolatedTime, Transformation t) {
            mProgress.setAlpha((int) (startingAlpha + ((endingAlpha - startingAlpha) * interpolatedTime)));
        }
    };
    alpha.setDuration(ALPHA_ANIMATION_DURATION);
    // Clear out the previous animation listeners.
    mCircleView.setAnimationListener(null);
    mCircleView.clearAnimation();
    mCircleView.startAnimation(alpha);
    return alpha;
}
Also used : Transformation(android.view.animation.Transformation) Animation(android.view.animation.Animation)

Example 93 with Transformation

use of android.view.animation.Transformation in project EasyRecyclerView by Jude95.

the class SwipeRefreshLayout method startAlphaAnimation.

private Animation startAlphaAnimation(final int startingAlpha, final int endingAlpha) {
    // show the trigger point.
    if (mScale && isAlphaUsedForScale()) {
        return null;
    }
    Animation alpha = new Animation() {

        @Override
        public void applyTransformation(float interpolatedTime, Transformation t) {
            mProgress.setAlpha((int) (startingAlpha + ((endingAlpha - startingAlpha) * interpolatedTime)));
        }
    };
    alpha.setDuration(ALPHA_ANIMATION_DURATION);
    // Clear out the previous animation listeners.
    mCircleView.setAnimationListener(null);
    mCircleView.clearAnimation();
    mCircleView.startAnimation(alpha);
    return alpha;
}
Also used : Transformation(android.view.animation.Transformation) Animation(android.view.animation.Animation)

Example 94 with Transformation

use of android.view.animation.Transformation in project EasyRecyclerView by Jude95.

the class SwipeRefreshLayout method startScaleDownAnimation.

void startScaleDownAnimation(AnimationListener listener) {
    mScaleDownAnimation = new Animation() {

        @Override
        public void applyTransformation(float interpolatedTime, Transformation t) {
            setAnimationProgress(1 - interpolatedTime);
        }
    };
    mScaleDownAnimation.setDuration(SCALE_DOWN_DURATION);
    mCircleView.setAnimationListener(listener);
    mCircleView.clearAnimation();
    mCircleView.startAnimation(mScaleDownAnimation);
}
Also used : Transformation(android.view.animation.Transformation) Animation(android.view.animation.Animation)

Example 95 with Transformation

use of android.view.animation.Transformation in project EasyRecyclerView by Jude95.

the class SwipeRefreshLayout method startScaleDownReturnToStartAnimation.

private void startScaleDownReturnToStartAnimation(int from, AnimationListener listener) {
    mFrom = from;
    if (isAlphaUsedForScale()) {
        mStartingScale = mProgress.getAlpha();
    } else {
        mStartingScale = ViewCompat.getScaleX(mCircleView);
    }
    mScaleDownToStartAnimation = new Animation() {

        @Override
        public void applyTransformation(float interpolatedTime, Transformation t) {
            float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
            setAnimationProgress(targetScale);
            moveToStart(interpolatedTime);
        }
    };
    mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
    if (listener != null) {
        mCircleView.setAnimationListener(listener);
    }
    mCircleView.clearAnimation();
    mCircleView.startAnimation(mScaleDownToStartAnimation);
}
Also used : Transformation(android.view.animation.Transformation) Animation(android.view.animation.Animation)

Aggregations

Transformation (android.view.animation.Transformation)108 Animation (android.view.animation.Animation)61 Point (android.graphics.Point)24 Paint (android.graphics.Paint)22 AlphaAnimation (android.view.animation.AlphaAnimation)18 Animatable (android.graphics.drawable.Animatable)17 LinearInterpolator (android.view.animation.LinearInterpolator)17 Matrix (android.graphics.Matrix)15 RectF (android.graphics.RectF)13 Rect (android.graphics.Rect)7 Bitmap (android.graphics.Bitmap)6 MagnificationSpec (android.view.MagnificationSpec)5 View (android.view.View)3 BezierDecelerateInterpolator (acr.browser.lightning.interpolator.BezierDecelerateInterpolator)2 CoordinatorLayout (android.support.design.widget.CoordinatorLayout)2 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)2 WindowPanel (com.android.server.wm.WindowManagerService.WindowPanel)2 Fragment (android.app.Fragment)1 FragmentTransaction (android.app.FragmentTransaction)1 Intent (android.content.Intent)1