Search in sources :

Example 16 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 17 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 18 with ViewPropertyAnimator

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

the class FixLayoutHelper method addFixViewWithAnimator.

private void addFixViewWithAnimator(LayoutManagerHelper layoutManagerHelper, View fixView) {
    if (mFixViewAnimatorHelper != null) {
        ViewPropertyAnimator animator = mFixViewAnimatorHelper.onGetFixViewAppearAnimator(fixView);
        if (animator != null) {
            fixView.setVisibility(View.INVISIBLE);
            layoutManagerHelper.addFixedView(fixView);
            mFixViewAppearAnimatorListener.bindAction(layoutManagerHelper, fixView);
            animator.setListener(mFixViewAppearAnimatorListener).start();
        } else {
            layoutManagerHelper.addFixedView(fixView);
        }
    } else {
        layoutManagerHelper.addFixedView(fixView);
    }
    isRemoveFixViewImmediately = false;
}
Also used : ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 19 with ViewPropertyAnimator

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

the class RecentsPanelView method animateInIconOfFirstTask.

private void animateInIconOfFirstTask() {
    if (mItemToAnimateInWhenWindowAnimationIsFinished != null && !mRecentTasksLoader.isFirstScreenful()) {
        int timeSinceWindowAnimation = (int) (System.currentTimeMillis() - mWindowAnimationStartTime);
        final int minStartDelay = 150;
        final int startDelay = Math.max(0, Math.min(minStartDelay - timeSinceWindowAnimation, minStartDelay));
        final int duration = 250;
        final ViewHolder holder = mItemToAnimateInWhenWindowAnimationIsFinished;
        final TimeInterpolator cubic = new DecelerateInterpolator(1.5f);
        FirstFrameAnimatorHelper.initializeDrawListener(holder.iconView);
        for (View v : new View[] { holder.iconView, holder.labelView, holder.calloutLine }) {
            if (v != null) {
                ViewPropertyAnimator vpa = v.animate().translationX(0).translationY(0).alpha(1f).setStartDelay(startDelay).setDuration(duration).setInterpolator(cubic);
                FirstFrameAnimatorHelper h = new FirstFrameAnimatorHelper(vpa, v);
            }
        }
        mItemToAnimateInWhenWindowAnimationIsFinished = null;
        mAnimateIconOfFirstTask = false;
    }
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) TimeInterpolator(android.animation.TimeInterpolator) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Example 20 with ViewPropertyAnimator

use of android.view.ViewPropertyAnimator in project platform_frameworks_base by android.

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)

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