Search in sources :

Example 6 with ViewPropertyAnimator

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

the class GUIUtils method startScaleAnimationFromPivot.

public static void startScaleAnimationFromPivot(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).scaleX(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 7 with ViewPropertyAnimator

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

the class GUIUtils method showViewByScale.

public static ViewPropertyAnimator showViewByScale(View v, AnimatorListener animatorListener) {
    ViewPropertyAnimator propertyAnimator = v.animate().setStartDelay(SCALE_DELAY).scaleY(1).scaleX(1);
    propertyAnimator.setListener(animatorListener);
    return propertyAnimator;
}
Also used : ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 8 with ViewPropertyAnimator

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

the class GUIUtils method hideViewByScaleY.

public static ViewPropertyAnimator hideViewByScaleY(View v, AnimatorListener animatorListener) {
    ViewPropertyAnimator propertyAnimator = v.animate().setStartDelay(SCALE_DELAY).scaleY(0);
    propertyAnimator.setListener(animatorListener);
    return propertyAnimator;
}
Also used : ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 9 with ViewPropertyAnimator

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

the class TransitionSecondActivity method onBackPressed.

@Override
public void onBackPressed() {
    for (int i = 0; i < rowContainer.getChildCount(); i++) {
        View rowView = rowContainer.getChildAt(i);
        ViewPropertyAnimator propertyAnimator = rowView.animate().setStartDelay(i * SCALE_DELAY).scaleX(0).scaleY(0).setListener(new AnimatorAdapter() {

            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                finishAfterTransition();
            }
        });
    }
}
Also used : AnimatorAdapter(com.saulmm.material.utils.AnimatorAdapter) Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) View(android.view.View) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 10 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project vlayout by alibaba.

the class FixLayoutHelper method removeFixViewWithAnimator.

private void removeFixViewWithAnimator(RecyclerView.Recycler recycler, LayoutManagerHelper layoutManagerHelper, View fixView) {
    if (!isRemoveFixViewImmediately && mFixViewAnimatorHelper != null) {
        ViewPropertyAnimator animator = mFixViewAnimatorHelper.onGetFixViewDisappearAnimator(fixView);
        if (animator != null) {
            mFixViewDisappearAnimatorListener.bindAction(recycler, layoutManagerHelper, fixView);
            animator.setListener(mFixViewDisappearAnimatorListener).start();
            isAddFixViewImmediately = false;
        } else {
            layoutManagerHelper.removeChildView(fixView);
            recycler.recycleView(fixView);
            isAddFixViewImmediately = false;
        }
    } else {
        layoutManagerHelper.removeChildView(fixView);
        recycler.recycleView(fixView);
        isAddFixViewImmediately = false;
    }
}
Also used : ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Aggregations

ViewPropertyAnimator (android.view.ViewPropertyAnimator)31 Animator (android.animation.Animator)11 View (android.view.View)3 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)3 ViewTreeObserver (android.view.ViewTreeObserver)2 ImageView (android.widget.ImageView)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 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 AdapterView (android.widget.AdapterView)1 AnimatorAdapter (com.saulmm.material.utils.AnimatorAdapter)1 Expo (com.waz.zclient.ui.animation.interpolators.penner.Expo)1 TouchImageView (com.waz.zclient.views.images.TouchImageView)1 AnimatorListener (net.qiujuer.genius.ui.animation.AnimatorListener)1