Search in sources :

Example 71 with RotateAnimation

use of android.view.animation.RotateAnimation in project BaseProject by fly803.

the class AnimationUtils method initRotateAnimation.

public static RotateAnimation initRotateAnimation(long duration, int fromAngle, int toAngle, boolean isFillAfter, int repeatCount) {
    RotateAnimation mLoadingRotateAnimation = new RotateAnimation(fromAngle, toAngle, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    LinearInterpolator lirInterpolator = new LinearInterpolator();
    mLoadingRotateAnimation.setInterpolator(lirInterpolator);
    mLoadingRotateAnimation.setDuration(duration);
    mLoadingRotateAnimation.setFillAfter(isFillAfter);
    mLoadingRotateAnimation.setRepeatCount(repeatCount);
    mLoadingRotateAnimation.setRepeatMode(Animation.RESTART);
    return mLoadingRotateAnimation;
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator)

Example 72 with RotateAnimation

use of android.view.animation.RotateAnimation in project EssayJoke by qiyei2015.

the class CommonRefreshView method onRunning.

@Override
public void onRunning() {
    // 刷新的时候不断旋转
    RotateAnimation animation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setRepeatCount(-1);
    animation.setDuration(1000);
    mRefreshIv.startAnimation(animation);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation)

Example 73 with RotateAnimation

use of android.view.animation.RotateAnimation in project vlc-android by GeoffreyMetais.

the class UiTools method fillAboutView.

public static void fillAboutView(View v) {
    final TextView link = v.findViewById(R.id.main_link);
    link.setText(Html.fromHtml(VLCApplication.getAppResources().getString(R.string.about_link)));
    final String revision = VLCApplication.getAppResources().getString(R.string.build_revision) + " VLC: " + VLCApplication.getAppResources().getString(R.string.build_vlc_revision);
    final String builddate = VLCApplication.getAppResources().getString(R.string.build_time);
    final String builder = VLCApplication.getAppResources().getString(R.string.build_host);
    final TextView compiled = v.findViewById(R.id.main_compiled);
    compiled.setText(builder + " (" + builddate + ")");
    final TextView textview_rev = v.findViewById(R.id.main_revision);
    textview_rev.setText(VLCApplication.getAppResources().getString(R.string.revision) + " " + revision + " (" + builddate + ") " + BuildConfig.FLAVOR_abi);
    final ImageView logo = v.findViewById(R.id.logo);
    logo.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            AnimationSet anim = new AnimationSet(true);
            RotateAnimation rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
            rotate.setDuration(800);
            rotate.setInterpolator(new DecelerateInterpolator());
            anim.addAnimation(rotate);
            logo.startAnimation(anim);
        }
    });
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) RotateAnimation(android.view.animation.RotateAnimation) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) AnimationSet(android.view.animation.AnimationSet)

Example 74 with RotateAnimation

use of android.view.animation.RotateAnimation in project weiui by kuaifan.

the class OptAnimationLoader method createAnimationFromXml.

private static Animation createAnimationFromXml(Context c, XmlPullParser parser, AnimationSet parent, AttributeSet attrs) throws XmlPullParserException, IOException {
    Animation anim = null;
    // Make sure we are on a start tag.
    int type;
    int depth = parser.getDepth();
    while (((type = parser.next()) != XmlPullParser.END_TAG || parser.getDepth() > depth) && type != XmlPullParser.END_DOCUMENT) {
        if (type != XmlPullParser.START_TAG) {
            continue;
        }
        String name = parser.getName();
        if (name.equals("set")) {
            anim = new AnimationSet(c, attrs);
            createAnimationFromXml(c, parser, (AnimationSet) anim, attrs);
        } else if (name.equals("alpha")) {
            anim = new AlphaAnimation(c, attrs);
        } else if (name.equals("scale")) {
            anim = new ScaleAnimation(c, attrs);
        } else if (name.equals("rotate")) {
            anim = new RotateAnimation(c, attrs);
        } else if (name.equals("translate")) {
            anim = new TranslateAnimation(c, attrs);
        } else {
            try {
                anim = (Animation) Class.forName(name).getConstructor(Context.class, AttributeSet.class).newInstance(c, attrs);
            } catch (Exception te) {
                throw new RuntimeException("Unknown animation name: " + parser.getName() + " error:" + te.getMessage());
            }
        }
        if (parent != null) {
            parent.addAnimation(anim);
        }
    }
    return anim;
}
Also used : Context(android.content.Context) RotateAnimation(android.view.animation.RotateAnimation) AttributeSet(android.util.AttributeSet) 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) AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation) IOException(java.io.IOException) XmlPullParserException(org.xmlpull.v1.XmlPullParserException) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 75 with RotateAnimation

use of android.view.animation.RotateAnimation in project CustomViews by AndroidStudy233.

the class ScaleHeadListView method rotateProgress.

/**
 * loading条旋转动画
 *
 * @param view custom
 */
public void rotateProgress(View view) {
    RotateAnimation animation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setDuration(1000);
    animation.setFillAfter(true);
    animation.setRepeatCount(Animation.INFINITE);
    view.setAnimation(animation);
}
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