Search in sources :

Example 21 with ViewPropertyAnimatorCompat

use of android.support.v4.view.ViewPropertyAnimatorCompat in project Android-MaterialRefreshLayout by android-cjj.

the class MaterialRefreshLayout method finishRefreshing.

public void finishRefreshing() {
    if (mChildView != null) {
        ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(mChildView);
        viewPropertyAnimatorCompat.setDuration(200);
        viewPropertyAnimatorCompat.y(ViewCompat.getTranslationY(mChildView));
        viewPropertyAnimatorCompat.translationY(0);
        viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
        viewPropertyAnimatorCompat.start();
        if (mMaterialHeaderView != null) {
            mMaterialHeaderView.onComlete(MaterialRefreshLayout.this);
        } else if (mSunLayout != null) {
            mSunLayout.onComlete(MaterialRefreshLayout.this);
        }
        if (refreshListener != null) {
            refreshListener.onfinish();
        }
    }
    isRefreshing = false;
    progressValue = 0;
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat)

Example 22 with ViewPropertyAnimatorCompat

use of android.support.v4.view.ViewPropertyAnimatorCompat in project Android-MaterialRefreshLayout by android-cjj.

the class MaterialRefreshLayout method createAnimatorTranslationY.

// public void setProgressValue(int progressValue) {
// this.progressValue = progressValue;
// mMaterialHeaderView.setProgressValue(progressValue);
// }
public void createAnimatorTranslationY(final View v, final float h, final FrameLayout fl) {
    ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
    viewPropertyAnimatorCompat.setDuration(250);
    viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
    viewPropertyAnimatorCompat.translationY(h);
    viewPropertyAnimatorCompat.start();
    viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(View view) {
            float height = ViewCompat.getTranslationY(v);
            fl.getLayoutParams().height = (int) height;
            fl.requestLayout();
        }
    });
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ViewPropertyAnimatorUpdateListener(android.support.v4.view.ViewPropertyAnimatorUpdateListener) ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat) AbsListView(android.widget.AbsListView) View(android.view.View)

Example 23 with ViewPropertyAnimatorCompat

use of android.support.v4.view.ViewPropertyAnimatorCompat in project animate by hitherejoe.

the class ForegroundFrame method addContentView.

private void addContentView(FrameLayout container) {
    inflate(getContext(), R.layout.layout_frame, this);
    FloatingActionButton floatingActionButton = (FloatingActionButton) findViewById(R.id.fab_quiz);
    floatingActionButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            ViewPropertyAnimatorCompat animatorCompat = buildAnimation(v);
            animatorCompat.setListener(new ViewPropertyAnimatorListener() {

                @Override
                public void onAnimationStart(View view) {
                }

                @Override
                public void onAnimationEnd(View view) {
                    doStuff();
                }

                @Override
                public void onAnimationCancel(View view) {
                }
            });
        }
    });
}
Also used : ViewPropertyAnimatorListener(android.support.v4.view.ViewPropertyAnimatorListener) FloatingActionButton(android.support.design.widget.FloatingActionButton) ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat) View(android.view.View)

Example 24 with ViewPropertyAnimatorCompat

use of android.support.v4.view.ViewPropertyAnimatorCompat in project BottomBar by roughike.

the class BottomBarTab method animateTitle.

private void animateTitle(int padding, float scale, float alpha) {
    if (type == Type.TABLET && isTitleless) {
        return;
    }
    setTopPaddingAnimated(iconView.getPaddingTop(), padding);
    ViewPropertyAnimatorCompat titleAnimator = ViewCompat.animate(titleView).setDuration(ANIMATION_DURATION).scaleX(scale).scaleY(scale);
    titleAnimator.alpha(alpha);
    titleAnimator.start();
}
Also used : ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat)

Example 25 with ViewPropertyAnimatorCompat

use of android.support.v4.view.ViewPropertyAnimatorCompat in project RecyclerViewItemAnimators by gabrielemariotti.

the class BaseItemAnimator method animateChangeImpl.

private void animateChangeImpl(final ChangeInfo changeInfo) {
    final RecyclerView.ViewHolder holder = changeInfo.oldHolder;
    final View view = holder == null ? null : holder.itemView;
    final RecyclerView.ViewHolder newHolder = changeInfo.newHolder;
    final View newView = newHolder != null ? newHolder.itemView : null;
    if (view != null) {
        final ViewPropertyAnimatorCompat oldViewAnim = ViewCompat.animate(view).setDuration(getChangeDuration());
        mChangeAnimations.add(changeInfo.oldHolder);
        oldViewAnim.translationX(changeInfo.toX - changeInfo.fromX);
        oldViewAnim.translationY(changeInfo.toY - changeInfo.fromY);
        oldViewAnim.alpha(0).setListener(new VpaListenerAdapter() {

            @Override
            public void onAnimationStart(View view) {
                dispatchChangeStarting(changeInfo.oldHolder, true);
            }

            @Override
            public void onAnimationEnd(View view) {
                oldViewAnim.setListener(null);
                ViewCompat.setAlpha(view, 1);
                ViewCompat.setTranslationX(view, 0);
                ViewCompat.setTranslationY(view, 0);
                dispatchChangeFinished(changeInfo.oldHolder, true);
                mChangeAnimations.remove(changeInfo.oldHolder);
                dispatchFinishedWhenDone();
            }
        }).start();
    }
    if (newView != null) {
        final ViewPropertyAnimatorCompat newViewAnimation = ViewCompat.animate(newView);
        mChangeAnimations.add(changeInfo.newHolder);
        newViewAnimation.translationX(0).translationY(0).setDuration(getChangeDuration()).alpha(1).setListener(new VpaListenerAdapter() {

            @Override
            public void onAnimationStart(View view) {
                dispatchChangeStarting(changeInfo.newHolder, false);
            }

            @Override
            public void onAnimationEnd(View view) {
                newViewAnimation.setListener(null);
                ViewCompat.setAlpha(newView, 1);
                ViewCompat.setTranslationX(newView, 0);
                ViewCompat.setTranslationY(newView, 0);
                dispatchChangeFinished(changeInfo.newHolder, false);
                mChangeAnimations.remove(changeInfo.newHolder);
                dispatchFinishedWhenDone();
            }
        }).start();
    }
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) ViewPropertyAnimatorCompat(android.support.v4.view.ViewPropertyAnimatorCompat) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Aggregations

ViewPropertyAnimatorCompat (android.support.v4.view.ViewPropertyAnimatorCompat)46 View (android.view.View)40 RecyclerView (android.support.v7.widget.RecyclerView)33 ViewHolder (android.support.v7.widget.RecyclerView.ViewHolder)6 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)3 BezierDecelerateInterpolator (acr.browser.lightning.interpolator.BezierDecelerateInterpolator)2 ViewPropertyAnimatorListener (android.support.v4.view.ViewPropertyAnimatorListener)2 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)2 FloatingActionButton (android.support.design.widget.FloatingActionButton)1 ViewPropertyAnimatorUpdateListener (android.support.v4.view.ViewPropertyAnimatorUpdateListener)1 AbsListView (android.widget.AbsListView)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1 AnimatorViewHolder (im.actor.sdk.controllers.fragment.AnimatorViewHolder)1 AnimateViewHolder (jp.wasabeef.recyclerview.animators.holder.AnimateViewHolder)1