Search in sources :

Example 21 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 22 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 23 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 24 with ViewPropertyAnimator

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

the class GUIUtils method showViewByScale.

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

Example 25 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)32 Animator (android.animation.Animator)11 View (android.view.View)4 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)3 ImageView (android.widget.ImageView)3 ViewTreeObserver (android.view.ViewTreeObserver)2 TextView (android.widget.TextView)2 AnimatorListener (android.animation.Animator.AnimatorListener)1 TimeInterpolator (android.animation.TimeInterpolator)1 TargetApi (android.annotation.TargetApi)1 PointF (android.graphics.PointF)1 Nullable (android.support.annotation.Nullable)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 AdapterView (android.widget.AdapterView)1 LayoutHelper (com.alibaba.android.vlayout.LayoutHelper)1 BaseLayoutHelper (com.alibaba.android.vlayout.layout.BaseLayoutHelper)1 FixAreaLayoutHelper (com.alibaba.android.vlayout.layout.FixAreaLayoutHelper)1 MarginLayoutHelper (com.alibaba.android.vlayout.layout.MarginLayoutHelper)1 AnimatorAdapter (com.saulmm.material.utils.AnimatorAdapter)1 CardSupport (com.tmall.wireless.tangram.support.CardSupport)1