Search in sources :

Example 56 with RenderNodeAnimator

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

the class OpaLayout method getTranslationAnimatorX.

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

Example 57 with RenderNodeAnimator

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

the class KeyguardAffordanceView method startRtCircleFadeOut.

private void startRtCircleFadeOut(long duration) {
    RenderNodeAnimator animator = new RenderNodeAnimator(mHwCirclePaint, RenderNodeAnimator.PAINT_ALPHA, 0);
    animator.setDuration(duration);
    animator.setInterpolator(Interpolators.ALPHA_OUT);
    animator.setTarget(this);
    animator.start();
}
Also used : RenderNodeAnimator(android.view.RenderNodeAnimator)

Example 58 with RenderNodeAnimator

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

the class MainActivity method onItemClick.

@Override
public void onItemClick(final AdapterView<?> adapterView, View clickedView, int clickedPosition, long clickedId) {
    int topPosition = adapterView.getFirstVisiblePosition();
    int dy = adapterView.getHeight();
    for (int i = 0; i < adapterView.getChildCount(); i++) {
        int pos = topPosition + i;
        View child = adapterView.getChildAt(i);
        float delta = (pos - clickedPosition) * 1.1f;
        if (delta == 0)
            delta = -1;
        RenderNodeAnimator animator = new RenderNodeAnimator(RenderNodeAnimator.TRANSLATION_Y, dy * delta);
        animator.setDuration(DURATION);
        if (child == clickedView)
            logTranslationY(clickedView);
        animator.setTarget(child);
        animator.start();
        if (child == clickedView)
            logTranslationY(clickedView);
    }
    //mHandler.postDelayed(mLaunchActivity, (long) (DURATION * .4));
    mLaunchActivity.run();
}
Also used : RenderNodeAnimator(android.view.RenderNodeAnimator) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 59 with RenderNodeAnimator

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

the class KeyButtonRipple method enterHardware.

private void enterHardware() {
    cancelAnimations();
    mDrawingHardwareGlow = true;
    setExtendStart(CanvasProperty.createFloat(getExtendSize() / 2));
    final RenderNodeAnimator startAnim = new RenderNodeAnimator(getExtendStart(), getExtendSize() / 2 - GLOW_MAX_SCALE_FACTOR * getRippleSize() / 2);
    startAnim.setDuration(ANIMATION_DURATION_SCALE);
    startAnim.setInterpolator(mInterpolator);
    startAnim.addListener(mAnimatorListener);
    startAnim.setTarget(mTargetView);
    setExtendEnd(CanvasProperty.createFloat(getExtendSize() / 2));
    final RenderNodeAnimator endAnim = new RenderNodeAnimator(getExtendEnd(), getExtendSize() / 2 + GLOW_MAX_SCALE_FACTOR * getRippleSize() / 2);
    endAnim.setDuration(ANIMATION_DURATION_SCALE);
    endAnim.setInterpolator(mInterpolator);
    endAnim.addListener(mAnimatorListener);
    endAnim.setTarget(mTargetView);
    if (isHorizontal()) {
        mTopProp = CanvasProperty.createFloat(0f);
        mBottomProp = CanvasProperty.createFloat(getBounds().height());
        mRxProp = CanvasProperty.createFloat(getBounds().height() / 2);
        mRyProp = CanvasProperty.createFloat(getBounds().height() / 2);
    } else {
        mLeftProp = CanvasProperty.createFloat(0f);
        mRightProp = CanvasProperty.createFloat(getBounds().width());
        mRxProp = CanvasProperty.createFloat(getBounds().width() / 2);
        mRyProp = CanvasProperty.createFloat(getBounds().width() / 2);
    }
    mGlowScale = GLOW_MAX_SCALE_FACTOR;
    mGlowAlpha = GLOW_MAX_ALPHA;
    mRipplePaint = getRipplePaint();
    mRipplePaint.setAlpha((int) (mGlowAlpha * 255));
    mPaintProp = CanvasProperty.createPaint(mRipplePaint);
    startAnim.start();
    endAnim.start();
    mRunningAnimations.add(startAnim);
    mRunningAnimations.add(endAnim);
    invalidateSelf();
}
Also used : RenderNodeAnimator(android.view.RenderNodeAnimator)

Example 60 with RenderNodeAnimator

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

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)

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