use of android.view.animation.RotateAnimation in project Android-Bootstrap by Bearded-Hen.
the class AwesomeTextView method startRotate.
/**
* Starts a rotating animation on the AwesomeTextView
*
* @param clockwise true for clockwise, false for anti clockwise spinning
* @param speed how fast the item should rotate
*/
public void startRotate(boolean clockwise, AnimationSpeed speed) {
Animation rotate;
// set up the rotation animation
if (clockwise) {
rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
} else {
rotate = new RotateAnimation(360, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
}
// set up some extra variables
rotate.setRepeatCount(Animation.INFINITE);
rotate.setInterpolator(new LinearInterpolator());
rotate.setStartOffset(0);
rotate.setRepeatMode(Animation.RESTART);
rotate.setDuration(speed.getRotateDuration());
startAnimation(rotate);
}
use of android.view.animation.RotateAnimation in project AgileDev by LZ9.
the class AnimUtils method startRotateSelf.
/**
* 旋转自身
* @param view 控件
* @param fromDegrees 起始角度
* @param toDegrees 结束角度
* @param duration 时间
* @param fillAfter 动画转化结束后被应用
*/
public static void startRotateSelf(View view, float fromDegrees, float toDegrees, long duration, boolean fillAfter) {
view.clearAnimation();
Animation animation = new RotateAnimation(fromDegrees, toDegrees, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animation.setDuration(duration);
// 设置为true,动画转化结束后被应用
animation.setFillAfter(fillAfter);
// 开始动画
view.startAnimation(animation);
}
use of android.view.animation.RotateAnimation in project incubator-weex by apache.
the class SplashActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
View textView = findViewById(R.id.fullscreen_content);
ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
RotateAnimation rotateAnimation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
AnimationSet animationSet = new AnimationSet(false);
animationSet.addAnimation(scaleAnimation);
animationSet.addAnimation(rotateAnimation);
animationSet.setDuration(1500);
animationSet.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
startActivity(new Intent(SplashActivity.this, IndexActivity.class));
finish();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
textView.startAnimation(animationSet);
}
use of android.view.animation.RotateAnimation in project BaseProject by wareine.
the class JxbRefreshFooter method initView.
private void initView(Context context) {
this.setGravity(Gravity.CENTER);
this.setOrientation(LinearLayout.HORIZONTAL);
mTitleText = new TextView(context);
mTitleText.setText(REFRESH_FOOTER_PULLUP);
mTitleText.setTextColor(0xff8b8b8b);
mTitleText.setTextSize(12);
LayoutParams lpProgress = new LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
mProgressView = new ImageView(context);
mProgressView.setImageResource(R.drawable.default_ptr_rotate);
addView(mProgressView, lpProgress);
LayoutParams lpHeaderText = new LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
lpHeaderText.leftMargin = DensityUtil.dp2px(10);
addView(mTitleText, lpHeaderText);
setMinimumHeight(DensityUtil.dp2px(40));
mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
mRotateAnimation.setInterpolator(new LinearInterpolator());
mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
mRotateAnimation.setRepeatCount(Animation.INFINITE);
mRotateAnimation.setRepeatMode(Animation.RESTART);
}
use of android.view.animation.RotateAnimation in project BaseProject by wareine.
the class PtrJxbHeader method initView.
private void initView(Context context) {
this.setGravity(Gravity.CENTER);
this.setOrientation(LinearLayout.VERTICAL);
mTitleText = new TextView(context);
mTitleText.setText(REFRESH_HEADER_PULLDOWN);
mTitleText.setTextColor(0xff8b8b8b);
mTitleText.setTextSize(13);
LayoutParams lpProgress = new LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
mProgressView = new ImageView(context);
mProgressView.setImageResource(R.drawable.default_ptr_rotate);
addView(mProgressView, lpProgress);
LayoutParams lpHeaderText = new LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
lpHeaderText.topMargin = DisplayUtil.dp2px(context, 5);
addView(mTitleText, lpHeaderText);
setPadding(0, DisplayUtil.dp2px(context, 10), 0, DisplayUtil.dp2px(context, 18));
setMinimumHeight(DisplayUtil.dp2px(context, 60));
mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
mRotateAnimation.setInterpolator(new LinearInterpolator());
mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
mRotateAnimation.setRepeatCount(Animation.INFINITE);
mRotateAnimation.setRepeatMode(Animation.RESTART);
}
Aggregations