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;
}
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);
}
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);
}
});
}
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;
}
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);
}
Aggregations