Search in sources :

Example 91 with RotateAnimation

use of android.view.animation.RotateAnimation in project curb by irijwj.

the class AutoFitAdapter method animOpen.

private void animOpen(final View expandView, final ImageView rotateView) {
    expandView.setAlpha(0);
    float from = 0.0f;
    float to = 180.0f;
    RotateAnimation lc_rotateAnimation = new RotateAnimation(from, to, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    lc_rotateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    lc_rotateAnimation.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            rotateView.setImageResource(R.drawable.ic_info_item_less);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    Animator mOpenValueAnimator = createDropAnim(expandView, 0, mHiddenViewMeasuredHeight);
    mOpenValueAnimator.start();
    rotateView.startAnimation(lc_rotateAnimation);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) Animator(android.animation.Animator) ValueAnimator(android.animation.ValueAnimator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) RotateAnimation(android.view.animation.RotateAnimation) Animation(android.view.animation.Animation)

Example 92 with RotateAnimation

use of android.view.animation.RotateAnimation in project MyJapanese by 54wall.

the class LayoutAnimationHelper method getAnimationSetRotation.

/**
 * 旋转动画
 *
 * @return
 */
public AnimationSet getAnimationSetRotation() {
    AnimationSet animationSet = new AnimationSet(true);
    RotateAnimation rotateAnimation = new RotateAnimation(30, 0, RELATIVE_TO_SELF, 0.5f, RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setDuration(400);
    rotateAnimation.setInterpolator(new DecelerateInterpolator());
    animationSet.addAnimation(rotateAnimation);
    animationSet.setDuration(400);
    return animationSet;
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) RotateAnimation(android.view.animation.RotateAnimation) AnimationSet(android.view.animation.AnimationSet)

Example 93 with RotateAnimation

use of android.view.animation.RotateAnimation in project LiYuJapanese by 54wall.

the class LayoutAnimationHelper method getAnimationSetRotation.

/**
 * 旋转动画
 *
 * @return
 */
public AnimationSet getAnimationSetRotation() {
    AnimationSet animationSet = new AnimationSet(true);
    RotateAnimation rotateAnimation = new RotateAnimation(30, 0, RELATIVE_TO_SELF, 0.5f, RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setDuration(400);
    rotateAnimation.setInterpolator(new DecelerateInterpolator());
    animationSet.addAnimation(rotateAnimation);
    animationSet.setDuration(400);
    return animationSet;
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) RotateAnimation(android.view.animation.RotateAnimation) AnimationSet(android.view.animation.AnimationSet)

Example 94 with RotateAnimation

use of android.view.animation.RotateAnimation in project AndroidUtilLib by SiberiaDante.

the class SDRotateLayoutImageView method initAnimator.

private void initAnimator() {
    rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotate.setRepeatCount(-1);
    rotate.setInterpolator(new LinearInterpolator());
    rotate.setDuration(800);
    rotate.setFillAfter(true);
    imageView.startAnimation(rotate);
    isAnimatorStart = true;
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator)

Example 95 with RotateAnimation

use of android.view.animation.RotateAnimation in project robolectric by robolectric.

the class ShadowAnimationSetTest method start_shouldRunAnimation.

@Test
@Ignore("Needs additional work")
public void start_shouldRunAnimation() {
    final AnimationSet set = new AnimationSet(true);
    final Animation move = new TranslateAnimation(0, 100, 0, 100);
    move.setDuration(1000);
    move.setAnimationListener(moveListener);
    final Animation spin = new RotateAnimation(0, 360);
    spin.setDuration(1000);
    spin.setStartOffset(1000);
    spin.setAnimationListener(spinListener);
    set.start();
    verify(moveListener).onAnimationStart(move);
    Robolectric.flushForegroundThreadScheduler();
    verify(moveListener).onAnimationEnd(move);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) RotateAnimation(android.view.animation.RotateAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) AnimationSet(android.view.animation.AnimationSet) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

RotateAnimation (android.view.animation.RotateAnimation)117 LinearInterpolator (android.view.animation.LinearInterpolator)39 Animation (android.view.animation.Animation)30 AnimationSet (android.view.animation.AnimationSet)24 ImageView (android.widget.ImageView)18 ScaleAnimation (android.view.animation.ScaleAnimation)17 View (android.view.View)16 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)16 TextView (android.widget.TextView)16 AlphaAnimation (android.view.animation.AlphaAnimation)13 TranslateAnimation (android.view.animation.TranslateAnimation)9 Context (android.content.Context)5 LinearLayout (android.widget.LinearLayout)5 SuppressLint (android.annotation.SuppressLint)4 Intent (android.content.Intent)4 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)4 IOException (java.io.IOException)4 Paint (android.graphics.Paint)3 Drawable (android.graphics.drawable.Drawable)3 RecyclerView (android.support.v7.widget.RecyclerView)3