Search in sources :

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

Example 57 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project Launcher3 by chislon.

the class LauncherViewPropertyAnimator method onAnimationStart.

@Override
public void onAnimationStart(Animator animation) {
    // This is the first time we get a handle to the internal ValueAnimator
    // used by the ViewPropertyAnimator.
    mFirstFrameHelper.onAnimationStart(animation);
    for (int i = 0; i < mListeners.size(); i++) {
        Animator.AnimatorListener listener = mListeners.get(i);
        listener.onAnimationStart(this);
    }
    mRunning = true;
}
Also used : Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) AnimatorListener(android.animation.Animator.AnimatorListener)

Example 58 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project T-MVP by north2016.

the class MyCommentBehavior method hide.

// 隐藏时的动画
private void hide(final View view) {
    ViewPropertyAnimator animator = view.animate().translationY(viewY).setInterpolator(INTERPOLATOR).setDuration(200);
    animator.setListener(new Animator.AnimatorListener() {

        @Override
        public void onAnimationStart(Animator animator) {
            isAnimate = true;
        }

        @Override
        public void onAnimationEnd(Animator animator) {
            view.setVisibility(View.INVISIBLE);
            isAnimate = false;
        }

        @Override
        public void onAnimationCancel(Animator animator) {
            show(view);
        }

        @Override
        public void onAnimationRepeat(Animator animator) {
        }
    });
    animator.start();
}
Also used : Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 59 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project T-MVP by north2016.

the class MyCommentBehavior method show.

// 显示时的动画
private void show(final View view) {
    ViewPropertyAnimator animator = view.animate().translationY(0).setInterpolator(INTERPOLATOR).setDuration(200);
    animator.setListener(new Animator.AnimatorListener() {

        @Override
        public void onAnimationStart(Animator animator) {
            view.setVisibility(View.VISIBLE);
            isAnimate = true;
        }

        @Override
        public void onAnimationEnd(Animator animator) {
            isAnimate = false;
        }

        @Override
        public void onAnimationCancel(Animator animator) {
            hide(view);
        }

        @Override
        public void onAnimationRepeat(Animator animator) {
        }
    });
    animator.start();
}
Also used : Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 60 with ViewPropertyAnimator

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

the class GUIUtils method hideViewByScale.

public static void hideViewByScale(View view) {
    ViewPropertyAnimator propertyAnimator = view.animate().setStartDelay(SCALE_FACTOR).scaleX(0).scaleY(0);
    propertyAnimator.start();
}
Also used : ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Aggregations

ViewPropertyAnimator (android.view.ViewPropertyAnimator)63 Animator (android.animation.Animator)31 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)13 View (android.view.View)9 AnimatorListener (android.animation.Animator.AnimatorListener)7 ValueAnimator (android.animation.ValueAnimator)7 ObjectAnimator (android.animation.ObjectAnimator)4 SimpleItemAnimator (android.support.v7.widget.SimpleItemAnimator)4 ProgressCardView (org.wikipedia.feed.progress.ProgressCardView)4 ViewTreeObserver (android.view.ViewTreeObserver)3 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)3 ImageView (android.widget.ImageView)3 Point (android.graphics.Point)2 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)2 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)2 AdapterView (android.widget.AdapterView)2 TextView (android.widget.TextView)2 TimeInterpolator (android.animation.TimeInterpolator)1 TargetApi (android.annotation.TargetApi)1 Resources (android.content.res.Resources)1