Search in sources :

Example 66 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)

Example 67 with RenderNodeAnimator

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

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)

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