本文整理汇总了Java中android.view.animation.RotateAnimation.setStartOffset方法的典型用法代码示例。如果您正苦于以下问题:Java RotateAnimation.setStartOffset方法的具体用法?Java RotateAnimation.setStartOffset怎么用?Java RotateAnimation.setStartOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.animation.RotateAnimation
的用法示例。
在下文中一共展示了RotateAnimation.setStartOffset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: randomRotate
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
private RotateAnimation randomRotate(int duration) {
RotateAnimation rotate = new RotateAnimation(0, (float) ((Math.random() > 0.5f ? 1 : -1) * 360 / (Math.random() * 20000 + 1000) * duration),
Animation.RELATIVE_TO_SELF, (float) (Math.random() * 0.5f), Animation.RELATIVE_TO_SELF, (float) (Math.random() * 0.5f));
rotate.setRepeatCount(Animation.INFINITE);
rotate.setRepeatMode(Animation.RESTART);
rotate.setStartOffset(0);
rotate.setDuration(duration);
return rotate;
}
示例2: addTextRotateAnimations
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
private void addTextRotateAnimations(AnimationSet set) {
RotateAnimation mRotateUpAnim = new RotateAnimation(0.0f, ROTATION_ANGLE, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
mRotateUpAnim.setDuration(CHARACTER_ANIM_DURATION);
set.addAnimation(mRotateUpAnim);
RotateAnimation mRotateDownAnim = new RotateAnimation(ROTATION_ANGLE, 0.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
mRotateDownAnim.setDuration(CHARACTER_ANIM_DURATION);
mRotateDownAnim.setStartOffset(CHARACTER_ANIM_DURATION + 20);
mRotateDownAnim.setFillAfter(true);
set.addAnimation(mRotateDownAnim);
set.setInterpolator(interpolator);
}
示例3: getRotateAnimation
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
/**
* 旋转动画
*
* @return 旋转动画对象
*/
public static RotateAnimation getRotateAnimation() {
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setDuration(10 * 1000);
rotateAnimation.setRepeatCount(Integer.MAX_VALUE);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setStartOffset(0);
rotateAnimation.setRepeatMode(Animation.RESTART);
return rotateAnimation;
}