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