Search in sources :

Example 51 with RenderNodeAnimator

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

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 52 with RenderNodeAnimator

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

the class LockPatternView method startRtFloatAnimation.

private void startRtFloatAnimation(CanvasProperty<Float> property, float endValue, long delay, long duration, Interpolator interpolator) {
    RenderNodeAnimator animator = new RenderNodeAnimator(property, endValue);
    animator.setDuration(duration);
    animator.setStartDelay(delay);
    animator.setInterpolator(interpolator);
    animator.setTarget(this);
    animator.start();
}
Also used : RenderNodeAnimator(android.view.RenderNodeAnimator)

Example 53 with RenderNodeAnimator

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

the class LockPatternView method startRtAlphaAnimation.

private void startRtAlphaAnimation(CellState cellState, float endAlpha, long delay, long duration, Interpolator interpolator, Animator.AnimatorListener listener) {
    RenderNodeAnimator animator = new RenderNodeAnimator(cellState.hwPaint, RenderNodeAnimator.PAINT_ALPHA, (int) (endAlpha * 255));
    animator.setDuration(duration);
    animator.setStartDelay(delay);
    animator.setInterpolator(interpolator);
    animator.setTarget(this);
    animator.addListener(listener);
    animator.start();
}
Also used : RenderNodeAnimator(android.view.RenderNodeAnimator)

Example 54 with RenderNodeAnimator

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

the class OpaLayout method getTranslationAnimatorY.

private Animator getTranslationAnimatorY(View v, Interpolator interpolator, int duration) {
    RenderNodeAnimator anim = new RenderNodeAnimator(1, 0);
    anim.setTarget(v);
    anim.setInterpolator(interpolator);
    anim.setDuration(duration);
    return anim;
}
Also used : RenderNodeAnimator(android.view.RenderNodeAnimator)

Example 55 with RenderNodeAnimator

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

the class OpaLayout method getDeltaAnimatorY.

private Animator getDeltaAnimatorY(View v, Interpolator interpolator, float deltaY, int duration) {
    RenderNodeAnimator anim = new RenderNodeAnimator(9, (int) (v.getY() + deltaY));
    anim.setTarget(v);
    anim.setInterpolator(interpolator);
    anim.setDuration(duration);
    return anim;
}
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