Search in sources :

Example 71 with ViewPropertyAnimator

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

the class RecentsView method onBusEvent.

public final void onBusEvent(DraggingInRecentsEndedEvent event) {
    ViewPropertyAnimator animator = animate();
    if (event.velocity > mFlingAnimationUtils.getMinVelocityPxPerSecond()) {
        animator.translationY(getHeight());
        animator.withEndAction(new Runnable() {

            @Override
            public void run() {
                WindowManagerProxy.getInstance().maximizeDockedStack();
            }
        });
        mFlingAnimationUtils.apply(animator, getTranslationY(), getHeight(), event.velocity);
    } else {
        animator.translationY(0f);
        animator.setListener(null);
        mFlingAnimationUtils.apply(animator, getTranslationY(), 0, event.velocity);
    }
    animator.start();
}
Also used : ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 72 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project animate by hitherejoe.

the class ViewPropertyAnimatorActivity method buildAndStartAnimation.

private void buildAndStartAnimation(View view) {
    ViewPropertyAnimator animator = view.animate();
    if (mAnimateAlphaCheck.isChecked() || view.getAlpha() == 0f) {
        float animationValue = view.getAlpha() == 0f ? 1f : 0f;
        animator.alpha(animationValue);
    }
    if (mAnimateScaleCheck.isChecked()) {
        float animationValue = view.getScaleY() == 0f ? 1f : 0f;
        animator.scaleX(animationValue).scaleY(animationValue);
    }
    if (mAnimateZCheck.isChecked()) {
        float animationValue = view.getTranslationZ() != 25f ? 25f : 2f;
        animator.translationZ(animationValue);
    }
    if (mAnimationDurationCheck.isChecked()) {
        animator.setDuration(500l);
    }
    if (mAnimationDelayCheck.isChecked()) {
        animator.setStartDelay(500l);
    }
    animator.setInterpolator(getSelectedInterpolator());
    animator.start();
}
Also used : ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 73 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.

the class GUIUtils method startScaleAnimationFromPivotY.

public static void startScaleAnimationFromPivotY(int pivotX, int pivotY, final View v, final AnimatorListener animatorListener) {
    final AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
    v.setScaleY(SCALE_START_ANCHOR);
    v.setPivotX(pivotX);
    v.setPivotY(pivotY);
    v.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {

        @Override
        public boolean onPreDraw() {
            v.getViewTreeObserver().removeOnPreDrawListener(this);
            ViewPropertyAnimator viewPropertyAnimator = v.animate().setInterpolator(interpolator).scaleY(1).setDuration(SCALE_DELAY);
            if (animatorListener != null)
                viewPropertyAnimator.setListener(animatorListener);
            viewPropertyAnimator.start();
            return true;
        }
    });
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ViewTreeObserver(android.view.ViewTreeObserver) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 74 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.

the class GUIUtils method hideScaleAnimationFromPivot.

public static void hideScaleAnimationFromPivot(View v, AnimatorListener animatorListener) {
    ViewPropertyAnimator viewPropertyAnimator = v.animate().setInterpolator(new AccelerateDecelerateInterpolator()).scaleY(SCALE_START_ANCHOR).setDuration(SCALE_DELAY);
    if (animatorListener != null)
        viewPropertyAnimator.setListener(animatorListener);
    viewPropertyAnimator.start();
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 75 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.

the class GUIUtils method showViewByScaleY.

/**
 * Shows a view by scaling
 *
 * @param v the view to be scaled
 *
 * @return the ViewPropertyAnimation to manage the animation
 */
public static ViewPropertyAnimator showViewByScaleY(View v, AnimatorListener animatorListener) {
    ViewPropertyAnimator propertyAnimator = v.animate().setStartDelay(SCALE_DELAY).scaleY(1);
    propertyAnimator.setListener(animatorListener);
    return propertyAnimator;
}
Also used : ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Aggregations

ViewPropertyAnimator (android.view.ViewPropertyAnimator)104 Animator (android.animation.Animator)59 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)36 View (android.view.View)30 ValueAnimator (android.animation.ValueAnimator)23 ObjectAnimator (android.animation.ObjectAnimator)11 RecyclerView (androidx.recyclerview.widget.RecyclerView)9 AnimatorListener (android.animation.Animator.AnimatorListener)8 SimpleItemAnimator (androidx.recyclerview.widget.SimpleItemAnimator)7 SimpleItemAnimator (android.support.v7.widget.SimpleItemAnimator)4 ViewGroup (android.view.ViewGroup)4 ImageView (android.widget.ImageView)4 FastOutSlowInInterpolator (androidx.interpolator.view.animation.FastOutSlowInInterpolator)4 ProgressCardView (org.wikipedia.feed.progress.ProgressCardView)4 Paint (android.graphics.Paint)3 ViewTreeObserver (android.view.ViewTreeObserver)3 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)3 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)3 DialogCell (org.telegram.ui.Cells.DialogCell)3 Point (android.graphics.Point)2