Search in sources :

Example 6 with NameValuesHolder

use of android.view.ViewPropertyAnimator.NameValuesHolder in project android_frameworks_base by DirtyUnicorns.

the class ViewPropertyAnimatorRT method cancelAnimators.

private void cancelAnimators(ArrayList<NameValuesHolder> mPendingAnimations) {
    int size = mPendingAnimations.size();
    for (int i = 0; i < size; i++) {
        NameValuesHolder holder = mPendingAnimations.get(i);
        int property = RenderNodeAnimator.mapViewPropertyToRenderProperty(holder.mNameConstant);
        if (mAnimators[property] != null) {
            mAnimators[property].cancel();
            mAnimators[property] = null;
        }
    }
}
Also used : NameValuesHolder(android.view.ViewPropertyAnimator.NameValuesHolder)

Example 7 with NameValuesHolder

use of android.view.ViewPropertyAnimator.NameValuesHolder in project platform_frameworks_base by android.

the class ViewPropertyAnimatorRT method doStartAnimation.

private void doStartAnimation(ViewPropertyAnimator parent) {
    int size = parent.mPendingAnimations.size();
    long startDelay = parent.getStartDelay();
    long duration = parent.getDuration();
    TimeInterpolator interpolator = parent.getInterpolator();
    if (interpolator == null) {
        // Documented to be LinearInterpolator in ValueAnimator.setInterpolator
        interpolator = sLinearInterpolator;
    }
    if (!RenderNodeAnimator.isNativeInterpolator(interpolator)) {
        interpolator = new FallbackLUTInterpolator(interpolator, duration);
    }
    for (int i = 0; i < size; i++) {
        NameValuesHolder holder = parent.mPendingAnimations.get(i);
        int property = RenderNodeAnimator.mapViewPropertyToRenderProperty(holder.mNameConstant);
        final float finalValue = holder.mFromValue + holder.mDeltaValue;
        RenderNodeAnimator animator = new RenderNodeAnimator(property, finalValue);
        animator.setStartDelay(startDelay);
        animator.setDuration(duration);
        animator.setInterpolator(interpolator);
        animator.setTarget(mView);
        animator.start();
        mAnimators[property] = animator;
    }
    parent.mPendingAnimations.clear();
}
Also used : FallbackLUTInterpolator(com.android.internal.view.animation.FallbackLUTInterpolator) NameValuesHolder(android.view.ViewPropertyAnimator.NameValuesHolder) TimeInterpolator(android.animation.TimeInterpolator)

Example 8 with NameValuesHolder

use of android.view.ViewPropertyAnimator.NameValuesHolder in project platform_frameworks_base by android.

the class ViewPropertyAnimatorRT method cancelAnimators.

private void cancelAnimators(ArrayList<NameValuesHolder> mPendingAnimations) {
    int size = mPendingAnimations.size();
    for (int i = 0; i < size; i++) {
        NameValuesHolder holder = mPendingAnimations.get(i);
        int property = RenderNodeAnimator.mapViewPropertyToRenderProperty(holder.mNameConstant);
        if (mAnimators[property] != null) {
            mAnimators[property].cancel();
            mAnimators[property] = null;
        }
    }
}
Also used : NameValuesHolder(android.view.ViewPropertyAnimator.NameValuesHolder)

Example 9 with NameValuesHolder

use of android.view.ViewPropertyAnimator.NameValuesHolder in project android_frameworks_base by ResurrectionRemix.

the class ViewPropertyAnimatorRT method cancelAnimators.

private void cancelAnimators(ArrayList<NameValuesHolder> mPendingAnimations) {
    int size = mPendingAnimations.size();
    for (int i = 0; i < size; i++) {
        NameValuesHolder holder = mPendingAnimations.get(i);
        int property = RenderNodeAnimator.mapViewPropertyToRenderProperty(holder.mNameConstant);
        if (mAnimators[property] != null) {
            mAnimators[property].cancel();
            mAnimators[property] = null;
        }
    }
}
Also used : NameValuesHolder(android.view.ViewPropertyAnimator.NameValuesHolder)

Example 10 with NameValuesHolder

use of android.view.ViewPropertyAnimator.NameValuesHolder in project android_frameworks_base by crdroidandroid.

the class ViewPropertyAnimatorRT method doStartAnimation.

private void doStartAnimation(ViewPropertyAnimator parent) {
    int size = parent.mPendingAnimations.size();
    long startDelay = parent.getStartDelay();
    long duration = parent.getDuration();
    TimeInterpolator interpolator = parent.getInterpolator();
    if (interpolator == null) {
        // Documented to be LinearInterpolator in ValueAnimator.setInterpolator
        interpolator = sLinearInterpolator;
    }
    if (!RenderNodeAnimator.isNativeInterpolator(interpolator)) {
        interpolator = new FallbackLUTInterpolator(interpolator, duration);
    }
    for (int i = 0; i < size; i++) {
        NameValuesHolder holder = parent.mPendingAnimations.get(i);
        int property = RenderNodeAnimator.mapViewPropertyToRenderProperty(holder.mNameConstant);
        final float finalValue = holder.mFromValue + holder.mDeltaValue;
        RenderNodeAnimator animator = new RenderNodeAnimator(property, finalValue);
        animator.setStartDelay(startDelay);
        animator.setDuration(duration);
        animator.setInterpolator(interpolator);
        animator.setTarget(mView);
        animator.start();
        mAnimators[property] = animator;
    }
    parent.mPendingAnimations.clear();
}
Also used : FallbackLUTInterpolator(com.android.internal.view.animation.FallbackLUTInterpolator) NameValuesHolder(android.view.ViewPropertyAnimator.NameValuesHolder) TimeInterpolator(android.animation.TimeInterpolator)

Aggregations

NameValuesHolder (android.view.ViewPropertyAnimator.NameValuesHolder)10 TimeInterpolator (android.animation.TimeInterpolator)5 FallbackLUTInterpolator (com.android.internal.view.animation.FallbackLUTInterpolator)5