Search in sources :

Example 81 with RotateAnimation

use of android.view.animation.RotateAnimation in project appintroduction by eluleci.

the class TextBaloon method rotate.

private void rotate(float degree) {
    final RotateAnimation rotateAnim = new RotateAnimation(0.0f, degree, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    rotateAnim.setDuration(0);
    rotateAnim.setFillAfter(true);
    indicator.startAnimation(rotateAnim);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation)

Example 82 with RotateAnimation

use of android.view.animation.RotateAnimation in project LuaViewSDK by alibaba.

the class UDAnimation method build.

/**
 * build an animation
 *
 * @return
 */
public Animation build(View view) {
    Animation animation = null;
    if (view != null) {
        switch(mAnimationType) {
            case TYPE_ALPHA:
                if (this.mValues != null && this.mValues.length > 0) {
                    animation = new AlphaAnimation(view.getAlpha(), this.mValues[0]);
                }
                break;
            case TYPE_ROTATE:
                if (this.mValues != null && this.mValues.length > 0) {
                    animation = new RotateAnimation(view.getRotation(), this.mValues[0]);
                }
                break;
            case TYPE_SCALE:
                if (this.mValues != null && this.mValues.length > 1) {
                    animation = new ScaleAnimation(view.getScaleX(), this.mValues[0], view.getScaleY(), this.mValues[1]);
                }
                break;
            case TYPE_TRANSLATE:
                if (this.mValues != null && this.mValues.length > 1) {
                    animation = new TranslateAnimation(view.getX(), DimenUtil.dpiToPx(this.mValues[0]), view.getY(), DimenUtil.dpiToPx(this.mValues[1]));
                }
                break;
        }
        if (animation != null) {
            animation.setFillEnabled(true);
            // 默认结束后设置属性
            animation.setFillAfter(true);
            animation.setFillBefore(true);
            animation.setDuration(mDuration);
            animation.setStartOffset(mStartOffset);
            animation.setRepeatCount(mRepeatCount);
            if (mOnStartCallback != null || mOnRepeatCallback != null || mOnEndCallback != null) {
                animation.setAnimationListener(new Animation.AnimationListener() {

                    @Override
                    public void onAnimationStart(Animation animation) {
                        LuaUtil.callFunction(mOnStartCallback);
                    }

                    @Override
                    public void onAnimationEnd(Animation animation) {
                        LuaUtil.callFunction(mOnEndCallback);
                    }

                    @Override
                    public void onAnimationRepeat(Animation animation) {
                        LuaUtil.callFunction(mOnRepeatCallback);
                    }
                });
            }
        }
    }
    return animation;
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) ScaleAnimation(android.view.animation.ScaleAnimation) RotateAnimation(android.view.animation.RotateAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) TranslateAnimation(android.view.animation.TranslateAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 83 with RotateAnimation

use of android.view.animation.RotateAnimation in project smartmodule by carozhu.

the class AnimationController method scaleRotateOut.

public void scaleRotateOut(View view, long durationMillis, long delayMillis) {
    ScaleAnimation animation1 = new ScaleAnimation(1, 0, 1, 0, rela1, 0.5f, rela1, 0.5f);
    RotateAnimation animation2 = new RotateAnimation(0, 360, rela1, 0.5f, rela1, 0.5f);
    AnimationSet animation = new AnimationSet(false);
    animation.addAnimation(animation1);
    animation.addAnimation(animation2);
    baseOut(view, animation, durationMillis, delayMillis);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) AnimationSet(android.view.animation.AnimationSet) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 84 with RotateAnimation

use of android.view.animation.RotateAnimation in project smartmodule by carozhu.

the class AnimationController method scaleRotateIn.

public void scaleRotateIn(View view, long durationMillis, long delayMillis) {
    ScaleAnimation animation1 = new ScaleAnimation(0, 1, 0, 1, rela1, 0.5f, rela1, 0.5f);
    RotateAnimation animation2 = new RotateAnimation(0, 360, rela1, 0.5f, rela1, 0.5f);
    AnimationSet animation = new AnimationSet(false);
    animation.addAnimation(animation1);
    animation.addAnimation(animation2);
    baseIn(view, animation, durationMillis, delayMillis);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) AnimationSet(android.view.animation.AnimationSet) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 85 with RotateAnimation

use of android.view.animation.RotateAnimation in project KJFrameForAndroid by kymjs.

the class HeaderLoadingLayout method init.

private void init(Context context) {
    mHeaderContainer = (RelativeLayout) findViewById(R.id.pull_to_refresh_header_content);
    mArrowImageView = (ImageView) findViewById(R.id.pull_to_refresh_header_arrow);
    mHintTextView = (TextView) findViewById(R.id.pull_to_refresh_header_hint_textview);
    mArrowImageView.setScaleType(ScaleType.CENTER);
    mArrowImageView.setImageResource(R.drawable.default_ptr_rotate);
    // SUPPRESS CHECKSTYLE
    float pivotValue = 0.5f;
    // SUPPRESS CHECKSTYLE
    float toDegree = 720.0f;
    mRotateAnimation = new RotateAnimation(0.0f, toDegree, Animation.RELATIVE_TO_SELF, pivotValue, Animation.RELATIVE_TO_SELF, pivotValue);
    mRotateAnimation.setFillAfter(true);
    mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
    mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
    mRotateAnimation.setRepeatCount(Animation.INFINITE);
    mRotateAnimation.setRepeatMode(Animation.RESTART);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation)

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