Search in sources :

Example 26 with RotateAnimation

use of android.view.animation.RotateAnimation in project ArcMenu by daCapricorn.

the class ArcLayout method createShrinkAnimation.

private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) {
    AnimationSet animationSet = new AnimationSet(false);
    animationSet.setFillAfter(true);
    final long preDuration = duration / 2;
    Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setStartOffset(startOffset);
    rotateAnimation.setDuration(preDuration);
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setFillAfter(true);
    animationSet.addAnimation(rotateAnimation);
    Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
    translateAnimation.setStartOffset(startOffset + preDuration);
    translateAnimation.setDuration(duration - preDuration);
    translateAnimation.setInterpolator(interpolator);
    translateAnimation.setFillAfter(true);
    animationSet.addAnimation(translateAnimation);
    return animationSet;
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) RotateAnimation(android.view.animation.RotateAnimation) Animation(android.view.animation.Animation) AnimationSet(android.view.animation.AnimationSet)

Example 27 with RotateAnimation

use of android.view.animation.RotateAnimation in project 91Pop by DanteAndroid.

the class AnimationUtils method rotateUp.

public static void rotateUp(View view) {
    RotateAnimation rotate = new RotateAnimation(0f, 180f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    LinearInterpolator lin = new LinearInterpolator();
    rotate.setInterpolator(lin);
    rotate.setDuration(200);
    rotate.setRepeatCount(0);
    rotate.setFillAfter(true);
    rotate.setStartOffset(10);
    view.startAnimation(rotate);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator)

Example 28 with RotateAnimation

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

the class PullingLayout method initView.

private void initView(Context context) {
    dm = context.getResources().getDisplayMetrics();
    mContext = context;
    TypedArray array = mContext.getTheme().obtainStyledAttributes(new int[] { android.R.attr.colorForeground, android.R.attr.colorBackground });
    mForegroundColor = array.getColor(0, 0xFFFFFFFF);
    mBackgroundColor = array.getColor(1, 0xFF000000);
    array.recycle();
    setStateColor(mForegroundColor);
    mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    refreshView = new HeadView(mContext);
    super.addView(refreshView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    pullableLayout = new FrameLayout(mContext);
    super.addView(pullableLayout, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    loadmoreView = new FootView(mContext);
    super.addView(loadmoreView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    pullableLayout = (FrameLayout) getChildAt(1);
    initView();
    timer = new MyTimer(updateHandler);
    rotateAnimation = new RotateAnimation(0, 180, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setDuration(100);
    rotateAnimation.setRepeatCount(0);
    rotateAnimation.setFillAfter(true);
    refreshingAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    refreshingAnimation.setDuration(1500);
    refreshingAnimation.setRepeatCount(-1);
    refreshingAnimation.setFillAfter(true);
    // 添加匀速转动动画
    LinearInterpolator lir = new LinearInterpolator();
    rotateAnimation.setInterpolator(lir);
    refreshingAnimation.setInterpolator(lir);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) TypedArray(android.content.res.TypedArray)

Example 29 with RotateAnimation

use of android.view.animation.RotateAnimation in project CloudReader by youlookwhat.

the class GankHomeFragment method initAnimation.

private void initAnimation() {
    bindingView.llLoading.setVisibility(View.VISIBLE);
    animation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    // 设置动画持续时间
    animation.setDuration(3000);
    // 不停顿
    animation.setInterpolator(new LinearInterpolator());
    // 重新从头执行
    animation.setRepeatMode(ValueAnimator.RESTART);
    // 设置重复次数
    animation.setRepeatCount(ValueAnimator.INFINITE);
    bindingView.ivLoading.setAnimation(animation);
    animation.startNow();
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator)

Example 30 with RotateAnimation

use of android.view.animation.RotateAnimation in project CloudReader by youlookwhat.

the class EverydayFragment method initAnimation.

private void initAnimation() {
    bindingView.llLoading.setVisibility(View.VISIBLE);
    animation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    // 设置动画持续时间
    animation.setDuration(3000);
    // 不停顿
    animation.setInterpolator(new LinearInterpolator());
    // 重新从头执行
    animation.setRepeatMode(ValueAnimator.RESTART);
    // 设置重复次数
    animation.setRepeatCount(ValueAnimator.INFINITE);
    bindingView.ivLoading.setAnimation(animation);
    animation.startNow();
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator)

Aggregations

RotateAnimation (android.view.animation.RotateAnimation)111 LinearInterpolator (android.view.animation.LinearInterpolator)38 Animation (android.view.animation.Animation)27 AnimationSet (android.view.animation.AnimationSet)24 ScaleAnimation (android.view.animation.ScaleAnimation)17 ImageView (android.widget.ImageView)15 View (android.view.View)14 TextView (android.widget.TextView)14 AlphaAnimation (android.view.animation.AlphaAnimation)13 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)12 TranslateAnimation (android.view.animation.TranslateAnimation)9 Context (android.content.Context)5 LinearLayout (android.widget.LinearLayout)5 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 AttributeSet (android.util.AttributeSet)3