Search in sources :

Example 26 with ObjectAnimator

use of android.animation.ObjectAnimator in project android_frameworks_base by ParanoidAndroid.

the class AdapterViewAnimator method getDefaultOutAnimation.

ObjectAnimator getDefaultOutAnimation() {
    ObjectAnimator anim = ObjectAnimator.ofFloat(null, "alpha", 1.0f, 0.0f);
    anim.setDuration(DEFAULT_ANIMATION_DURATION);
    return anim;
}
Also used : ObjectAnimator(android.animation.ObjectAnimator)

Example 27 with ObjectAnimator

use of android.animation.ObjectAnimator in project android_frameworks_base by ParanoidAndroid.

the class WebViewClassic method setTouchHighlightRects.

private void setTouchHighlightRects(WebKitHitTest hit) {
    FocusTransitionDrawable transition = null;
    if (shouldAnimateTo(hit)) {
        transition = new FocusTransitionDrawable(this);
    }
    Rect[] rects = hit != null ? hit.mTouchRects : null;
    if (!mTouchHighlightRegion.isEmpty()) {
        mWebView.invalidate(mTouchHighlightRegion.getBounds());
        if (transition != null) {
            transition.mPreviousRegion = new Region(mTouchHighlightRegion);
        }
        mTouchHighlightRegion.setEmpty();
    }
    if (rects != null) {
        mTouchHightlightPaint.setColor(hit.mTapHighlightColor);
        for (Rect rect : rects) {
            Rect viewRect = contentToViewRect(rect);
            // more than half of the screen.
            if (viewRect.width() < getWidth() >> 1 || viewRect.height() < getHeight() >> 1) {
                mTouchHighlightRegion.union(viewRect);
            } else if (DebugFlags.WEB_VIEW) {
                Log.d(LOGTAG, "Skip the huge selection rect:" + viewRect);
            }
        }
        mWebView.invalidate(mTouchHighlightRegion.getBounds());
        if (transition != null && transition.mPreviousRegion != null) {
            transition.mNewRegion = new Region(mTouchHighlightRegion);
            mFocusTransition = transition;
            ObjectAnimator animator = ObjectAnimator.ofFloat(mFocusTransition, "progress", 1f);
            animator.start();
        }
    }
}
Also used : Rect(android.graphics.Rect) ObjectAnimator(android.animation.ObjectAnimator) Region(android.graphics.Region)

Example 28 with ObjectAnimator

use of android.animation.ObjectAnimator in project android_frameworks_base by ParanoidAndroid.

the class ActionBarContextView method makeOutAnimation.

private Animator makeOutAnimation() {
    ObjectAnimator buttonAnimator = ObjectAnimator.ofFloat(mClose, "translationX", -mClose.getWidth() - ((MarginLayoutParams) mClose.getLayoutParams()).leftMargin);
    buttonAnimator.setDuration(200);
    buttonAnimator.addListener(this);
    buttonAnimator.setInterpolator(new DecelerateInterpolator());
    AnimatorSet set = new AnimatorSet();
    AnimatorSet.Builder b = set.play(buttonAnimator);
    if (mMenuView != null) {
        final int count = mMenuView.getChildCount();
        if (count > 0) {
            for (int i = 0; i < 0; i++) {
                View child = mMenuView.getChildAt(i);
                child.setScaleY(0);
                ObjectAnimator a = ObjectAnimator.ofFloat(child, "scaleY", 0);
                a.setDuration(300);
                b.with(a);
            }
        }
    }
    return set;
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ObjectAnimator(android.animation.ObjectAnimator) AnimatorSet(android.animation.AnimatorSet) ActionMenuView(com.android.internal.view.menu.ActionMenuView) TextView(android.widget.TextView) View(android.view.View)

Example 29 with ObjectAnimator

use of android.animation.ObjectAnimator in project android_frameworks_base by ParanoidAndroid.

the class ScrollingTabContainerView method animateToVisibility.

public void animateToVisibility(int visibility) {
    if (mVisibilityAnim != null) {
        mVisibilityAnim.cancel();
    }
    if (visibility == VISIBLE) {
        if (getVisibility() != VISIBLE) {
            setAlpha(0);
        }
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 1);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
        anim.start();
    } else {
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 0);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
        anim.start();
    }
}
Also used : ObjectAnimator(android.animation.ObjectAnimator)

Example 30 with ObjectAnimator

use of android.animation.ObjectAnimator in project android_frameworks_base by ParanoidAndroid.

the class DrawableHolder method startAnimations.

/**
     * Starts all animations added since the last call to this function.  Used to synchronize
     * animations.
     *
     * @param listener an optional listener to add to the animations. Typically used to know when
     * to invalidate the surface these are being drawn to.
     */
public void startAnimations(ValueAnimator.AnimatorUpdateListener listener) {
    for (int i = 0; i < mNeedToStart.size(); i++) {
        ObjectAnimator anim = mNeedToStart.get(i);
        anim.addUpdateListener(listener);
        anim.addListener(this);
        anim.start();
    }
    mNeedToStart.clear();
}
Also used : ObjectAnimator(android.animation.ObjectAnimator)

Aggregations

ObjectAnimator (android.animation.ObjectAnimator)767 Animator (android.animation.Animator)304 AnimatorSet (android.animation.AnimatorSet)209 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)202 PropertyValuesHolder (android.animation.PropertyValuesHolder)125 ValueAnimator (android.animation.ValueAnimator)111 View (android.view.View)99 Paint (android.graphics.Paint)68 TextView (android.widget.TextView)47 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)46 ViewGroup (android.view.ViewGroup)45 LinearInterpolator (android.view.animation.LinearInterpolator)36 Rect (android.graphics.Rect)34 ImageView (android.widget.ImageView)31 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)30 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)28 OvershootInterpolator (android.view.animation.OvershootInterpolator)27 ArrayList (java.util.ArrayList)21 Interpolator (android.view.animation.Interpolator)20 TargetApi (android.annotation.TargetApi)19