Search in sources :

Example 61 with RenderNodeAnimator

use of android.view.RenderNodeAnimator in project android_frameworks_base by DirtyUnicorns.

the class AppearAnimationUtils method startTranslationYAnimation.

public static void startTranslationYAnimation(View view, long delay, long duration, float endTranslationY, Interpolator interpolator) {
    Animator translationAnim;
    if (view.isHardwareAccelerated()) {
        RenderNodeAnimator translationAnimRt = new RenderNodeAnimator(RenderNodeAnimator.TRANSLATION_Y, endTranslationY);
        translationAnimRt.setTarget(view);
        translationAnim = translationAnimRt;
    } else {
        translationAnim = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, view.getTranslationY(), endTranslationY);
    }
    translationAnim.setInterpolator(interpolator);
    translationAnim.setDuration(duration);
    translationAnim.setStartDelay(delay);
    translationAnim.start();
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) RenderNodeAnimator(android.view.RenderNodeAnimator) Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) ValueAnimator(android.animation.ValueAnimator) RenderNodeAnimator(android.view.RenderNodeAnimator)

Example 62 with RenderNodeAnimator

use of android.view.RenderNodeAnimator in project android_frameworks_base by DirtyUnicorns.

the class KeyguardAffordanceView method startRtAlphaFadeIn.

/**
     * Fades in the Circle on the RenderThread. It's used when finishing the circle when it had
     * alpha 0 in the beginning.
     */
private void startRtAlphaFadeIn() {
    if (mCircleRadius == 0 && mPreviewView == null) {
        Paint modifiedPaint = new Paint(mCirclePaint);
        modifiedPaint.setColor(mCircleColor);
        modifiedPaint.setAlpha(0);
        mHwCirclePaint = CanvasProperty.createPaint(modifiedPaint);
        RenderNodeAnimator animator = new RenderNodeAnimator(mHwCirclePaint, RenderNodeAnimator.PAINT_ALPHA, 255);
        animator.setTarget(this);
        animator.setInterpolator(Interpolators.ALPHA_IN);
        animator.setDuration(250);
        animator.start();
    }
}
Also used : RenderNodeAnimator(android.view.RenderNodeAnimator) Paint(android.graphics.Paint)

Example 63 with RenderNodeAnimator

use of android.view.RenderNodeAnimator in project android_frameworks_base by DirtyUnicorns.

the class KeyguardAffordanceView method getRtAnimatorToRadius.

private Animator getRtAnimatorToRadius(float circleRadius) {
    RenderNodeAnimator animator = new RenderNodeAnimator(mHwCircleRadius, circleRadius);
    animator.setTarget(this);
    return animator;
}
Also used : RenderNodeAnimator(android.view.RenderNodeAnimator)

Example 64 with RenderNodeAnimator

use of android.view.RenderNodeAnimator in project android_frameworks_base by DirtyUnicorns.

the class RippleBackground method createHardwareExit.

@Override
protected RenderNodeAnimatorSet createHardwareExit(Paint p) {
    final RenderNodeAnimatorSet set = new RenderNodeAnimatorSet();
    final int targetAlpha = p.getAlpha();
    final int currentAlpha = (int) (mOpacity * targetAlpha + 0.5f);
    p.setAlpha(currentAlpha);
    mPropPaint = CanvasProperty.createPaint(p);
    mPropRadius = CanvasProperty.createFloat(mTargetRadius);
    mPropX = CanvasProperty.createFloat(0);
    mPropY = CanvasProperty.createFloat(0);
    final int fastEnterDuration = mIsBounded ? (int) ((1 - mOpacity) * OPACITY_ENTER_DURATION_FAST) : 0;
    // Linear exit after enter is completed.
    final RenderNodeAnimator exit = new RenderNodeAnimator(mPropPaint, RenderNodeAnimator.PAINT_ALPHA, 0);
    exit.setInterpolator(LINEAR_INTERPOLATOR);
    exit.setDuration(OPACITY_EXIT_DURATION);
    if (fastEnterDuration > 0) {
        exit.setStartDelay(fastEnterDuration);
        exit.setStartValue(targetAlpha);
    }
    set.add(exit);
    // Linear "fast" enter based on current opacity.
    if (fastEnterDuration > 0) {
        final RenderNodeAnimator enter = new RenderNodeAnimator(mPropPaint, RenderNodeAnimator.PAINT_ALPHA, targetAlpha);
        enter.setInterpolator(LINEAR_INTERPOLATOR);
        enter.setDuration(fastEnterDuration);
        set.add(enter);
    }
    return set;
}
Also used : RenderNodeAnimator(android.view.RenderNodeAnimator) Paint(android.graphics.Paint)

Example 65 with RenderNodeAnimator

use of android.view.RenderNodeAnimator in project android_frameworks_base by crdroidandroid.

the class KeyButtonRipple method exitHardware.

private void exitHardware() {
    mPaintProp = CanvasProperty.createPaint(getRipplePaint());
    final RenderNodeAnimator opacityAnim = new RenderNodeAnimator(mPaintProp, RenderNodeAnimator.PAINT_ALPHA, 0);
    opacityAnim.setDuration(ANIMATION_DURATION_FADE);
    opacityAnim.setInterpolator(Interpolators.ALPHA_OUT);
    opacityAnim.addListener(mAnimatorListener);
    opacityAnim.setTarget(mTargetView);
    opacityAnim.start();
    mRunningAnimations.add(opacityAnim);
    invalidateSelf();
}
Also used : RenderNodeAnimator(android.view.RenderNodeAnimator)

Aggregations

RenderNodeAnimator (android.view.RenderNodeAnimator)67 Paint (android.graphics.Paint)15 Animator (android.animation.Animator)10 ObjectAnimator (android.animation.ObjectAnimator)10 ValueAnimator (android.animation.ValueAnimator)10 ViewPropertyAnimator (android.view.ViewPropertyAnimator)10 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)5 View (android.view.View)4 AdapterView (android.widget.AdapterView)4 ListView (android.widget.ListView)4