Search in sources :

Example 46 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project AndroidResideMenu by SpecialCyCi.

the class ResideMenu method buildMenuAnimation.

private AnimatorSet buildMenuAnimation(View target, float alpha) {
    AnimatorSet alphaAnimation = new AnimatorSet();
    alphaAnimation.playTogether(ObjectAnimator.ofFloat(target, "alpha", alpha));
    alphaAnimation.setDuration(250);
    return alphaAnimation;
}
Also used : AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 47 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project AndroidResideMenu by SpecialCyCi.

the class ResideMenu method buildScaleUpAnimation.

/**
     * A helper method to build scale up animation;
     *
     * @param target
     * @param targetScaleX
     * @param targetScaleY
     * @return
     */
private AnimatorSet buildScaleUpAnimation(View target, float targetScaleX, float targetScaleY) {
    AnimatorSet scaleUp = new AnimatorSet();
    scaleUp.playTogether(ObjectAnimator.ofFloat(target, "scaleX", targetScaleX), ObjectAnimator.ofFloat(target, "scaleY", targetScaleY));
    if (mUse3D) {
        scaleUp.playTogether(ObjectAnimator.ofFloat(target, "rotationY", 0));
    }
    scaleUp.setDuration(250);
    return scaleUp;
}
Also used : AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 48 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project AndroidResideMenu by SpecialCyCi.

the class ResideMenu method buildScaleDownAnimation.

/**
     * A helper method to build scale down animation;
     *
     * @param target
     * @param targetScaleX
     * @param targetScaleY
     * @return
     */
private AnimatorSet buildScaleDownAnimation(View target, float targetScaleX, float targetScaleY) {
    AnimatorSet scaleDown = new AnimatorSet();
    scaleDown.playTogether(ObjectAnimator.ofFloat(target, "scaleX", targetScaleX), ObjectAnimator.ofFloat(target, "scaleY", targetScaleY));
    if (mUse3D) {
        int angle = scaleDirection == DIRECTION_LEFT ? -ROTATE_Y_ANGLE : ROTATE_Y_ANGLE;
        scaleDown.playTogether(ObjectAnimator.ofFloat(target, "rotationY", angle));
    }
    scaleDown.setInterpolator(AnimationUtils.loadInterpolator(activity, android.R.anim.decelerate_interpolator));
    scaleDown.setDuration(250);
    return scaleDown;
}
Also used : AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 49 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project ElasticDownload by Tibolte.

the class ProgressDownloadView method drawFail.

public void drawFail() {
    mState = State.STATE_FAILED;
    ObjectAnimator failAnim = ObjectAnimator.ofFloat(this, "failAngle", 0, 180);
    failAnim.setInterpolator(new OvershootInterpolator());
    //This one doesn't do much actually, we just use it to take advantage of associating two different interpolators
    ObjectAnimator anim = ObjectAnimator.ofFloat(this, "progress", getProgress(), mTarget);
    anim.setInterpolator(new AccelerateInterpolator());
    AnimatorSet set = new AnimatorSet();
    set.setDuration((long) (ANIMATION_DURATION_BASE / 1.7f));
    set.playTogether(failAnim, anim);
    set.start();
}
Also used : OvershootInterpolator(android.view.animation.OvershootInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 50 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project PhotoNoter by yydcdut.

the class PhotoDetailActivity method hideWidget.

@Override
public void hideWidget(final IPhotoDetailPresenter.OnAnimationAdapter onAnimationAdapter) {
    AnimatorSet animation = new AnimatorSet();
    animation.setDuration(1000);
    animation.playTogether(ObjectAnimator.ofFloat(mAppBarLayout, "Y", AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0, -getActionBarSize() - (AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0)), ObjectAnimator.ofFloat(mBottomLayout, "Y", mBottomLayout.getTop(), mBottomLayout.getTop() + getActionBarSize()), ObjectAnimator.ofFloat(mStatusCoverView, "Y", 0f, -getActionBarSize()));
    animation.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationStart(Animator animation) {
            if (onAnimationAdapter != null) {
                onAnimationAdapter.onAnimationStarted(IPhotoDetailPresenter.STATE_HIDE);
            }
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            if (onAnimationAdapter != null) {
                onAnimationAdapter.onAnimationEnded(IPhotoDetailPresenter.STATE_HIDE);
            }
        }
    });
    animation.start();
}
Also used : ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) Animator(com.nineoldandroids.animation.Animator) AnimatorListenerAdapter(com.nineoldandroids.animation.AnimatorListenerAdapter) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Aggregations

AnimatorSet (com.nineoldandroids.animation.AnimatorSet)57 ObjectAnimator (com.nineoldandroids.animation.ObjectAnimator)42 Animator (com.nineoldandroids.animation.Animator)24 AnimatorListenerAdapter (com.nineoldandroids.animation.AnimatorListenerAdapter)11 View (android.view.View)6 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)4 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)4 SuppressLint (android.annotation.SuppressLint)3 Paint (android.graphics.Paint)3 OvershootInterpolator (android.view.animation.OvershootInterpolator)3 Point (android.graphics.Point)2 DisplayMetrics (android.util.DisplayMetrics)2 LinearInterpolator (android.view.animation.LinearInterpolator)2 AdapterView (android.widget.AdapterView)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 ValueAnimator (com.nineoldandroids.animation.ValueAnimator)2 IDetailView (com.yydcdut.note.views.note.IDetailView)2 FontTextView (com.yydcdut.note.widget.FontTextView)2 RevealView (com.yydcdut.note.widget.RevealView)2