本文整理汇总了Java中android.view.animation.RotateAnimation.setInterpolator方法的典型用法代码示例。如果您正苦于以下问题:Java RotateAnimation.setInterpolator方法的具体用法?Java RotateAnimation.setInterpolator怎么用?Java RotateAnimation.setInterpolator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.animation.RotateAnimation
的用法示例。
在下文中一共展示了RotateAnimation.setInterpolator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FlipLoadingLayout
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
public FlipLoadingLayout(Context context, final Mode mode, final Orientation scrollDirection, TypedArray attrs) {
super(context, mode, scrollDirection, attrs);
final int rotateAngle = mode == Mode.PULL_FROM_START ? -180 : 180;
mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
mRotateAnimation.setFillAfter(true);
mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
mResetRotateAnimation.setFillAfter(true);
}
示例2: initAnimation
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
private void initAnimation() {
LinearInterpolator linearInterpolator=new LinearInterpolator();
flipUpAnimation =new RotateAnimation(0,-180,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
flipUpAnimation.setDuration(FLIP_DURATION);
flipUpAnimation.setFillAfter(true);
flipUpAnimation.setInterpolator(linearInterpolator);
flipDownAnimation=new RotateAnimation(-180,0,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
flipDownAnimation.setDuration(FLIP_DURATION);
flipDownAnimation.setFillAfter(true);
flipDownAnimation.setInterpolator(linearInterpolator);
infiniteRotation=new RotateAnimation(0,360,RotateAnimation.RELATIVE_TO_SELF,0.5f,RotateAnimation.RELATIVE_TO_SELF,0.5f);
infiniteRotation.setDuration(ROTATE_DURATION);
infiniteRotation.setRepeatCount(Animation.INFINITE);
infiniteRotation.setInterpolator(linearInterpolator);
}
示例3: FlipLoadingLayout
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
public FlipLoadingLayout(Context context, final PullToRefreshBase.Mode mode, final PullToRefreshBase.Orientation scrollDirection, TypedArray attrs) {
super(context, mode, scrollDirection, attrs);
final int rotateAngle = mode == PULL_FROM_START ? -180 : 180;
mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
mRotateAnimation.setFillAfter(true);
mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
mResetRotateAnimation.setFillAfter(true);
}
示例4: RotateLoadingLayout
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
super(context, mode, scrollDirection, attrs);
/**创建旋转动画*/
mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);
mHeaderImage.setScaleType(ScaleType.MATRIX);
mHeaderImageMatrix = new Matrix();
mHeaderImage.setImageMatrix(mHeaderImageMatrix);
mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
mRotateAnimation.setRepeatCount(Animation.INFINITE);
mRotateAnimation.setRepeatMode(Animation.RESTART);
}
示例5: rotate
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
public static void rotate(View v){
//创建旋转动画 对象 fromDegrees:旋转开始的角度 toDegrees:结束的角度
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
//设置动画的显示时间
rotateAnimation.setDuration(1000);
//设置动画重复播放几次
rotateAnimation.setRepeatCount(RotateAnimation.INFINITE);
//设置动画插值器
rotateAnimation.setInterpolator(new LinearInterpolator());
//设置动画重复播放的方式,翻转播放
rotateAnimation.setRepeatMode(Animation.RESTART);
//拿着imageview对象来运行动画效果
v.setAnimation(rotateAnimation);
}
示例6: 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;
}
示例7: buildAnimation
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
private void buildAnimation() {
mFlipAnimation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
mFlipAnimation.setInterpolator(new LinearInterpolator());
mFlipAnimation.setDuration(mRotateAniTime);
mFlipAnimation.setFillAfter(true);
mReverseFlipAnimation = new RotateAnimation(-180, 0, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
mReverseFlipAnimation.setDuration(mRotateAniTime);
mReverseFlipAnimation.setFillAfter(true);
}
示例8: getAnimation
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
public Animation getAnimation() {
if (hasAnimation) {
RotateAnimation anim = new RotateAnimation(0.0f, 360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(1000);
return anim;
}
return null;
}
示例9: rotatePlayPauseWrapper
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
/**
* Rotates the Play Pause wrapper with an Rotation Animation.
*/
private void rotatePlayPauseWrapper() {
RotateAnimation rotate = new RotateAnimation(mPlayPauseWrapper.getRotation(), 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotate.setDuration(PLAY_PAUSE_ANIMATION_DURATION);
rotate.setInterpolator(new AccelerateDecelerateInterpolator());
mPlayPauseWrapper.startAnimation(rotate);
}
示例10: loadLoadingAnimation
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
protected Animation loadLoadingAnimation() {
RotateAnimation rotateAnimation = new RotateAnimation(0, 360,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
setDefaultConfig(rotateAnimation, false);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setRepeatMode(Animation.RESTART);
rotateAnimation.setRepeatCount(Animation.INFINITE);
rotateAnimation.setDuration(1000);
return rotateAnimation;
}
示例11: rotateAnimation
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
public static Animation rotateAnimation(boolean circle /*循环动画*/) {
RotateAnimation animation = new RotateAnimation(0f, 360f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animation.setInterpolator(new LinearInterpolator());
animation.setDuration(300);
if (circle) {
animation.setRepeatCount(Animation.INFINITE);
animation.setRepeatMode(Animation.RESTART);
animation.setDuration(2000);
}
return animation;
}
示例12: animateSetExpanded
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
public static void animateSetExpanded(View view, boolean expanded) {
view.setRotation(expanded ? 180.f : 0.f);
int toDegrees = (expanded ? 0 : 360);
RotateAnimation rotate = new RotateAnimation(180, toDegrees,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotate.setDuration(250);
rotate.setInterpolator(new AccelerateDecelerateInterpolator());
view.startAnimation(rotate);
}
示例13: AddressRotationHeader
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
public AddressRotationHeader(Context context, int rotationSrc,RecyclerView recyclerView){
this.context = context;
this.rotationSrc = rotationSrc;
mRotateUpAnim = new RotateAnimation(0.0f, 360.0f,Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
mRotateUpAnim.setInterpolator(new LinearInterpolator());
mRotateUpAnim.setRepeatCount(Integer.MAX_VALUE);
mRotateUpAnim.setDuration(600);
mRotateUpAnim.setFillAfter(true);
}
示例14: IndicatorLayout
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
public IndicatorLayout(Context context, PullToRefreshBase.Mode mode) {
super(context);
mArrowImageView = new ImageView(context);
Drawable arrowD = getResources().getDrawable(R.drawable.indicator_arrow);
mArrowImageView.setImageDrawable(arrowD);
final int padding = getResources().getDimensionPixelSize(R.dimen.indicator_internal_padding);
mArrowImageView.setPadding(padding, padding, padding, padding);
addView(mArrowImageView);
int inAnimResId, outAnimResId;
switch (mode) {
case PULL_FROM_END:
inAnimResId = R.anim.slide_in_from_bottom;
outAnimResId = R.anim.slide_out_to_bottom;
setBackgroundResource(R.drawable.indicator_bg_bottom);
// Rotate Arrow so it's pointing the correct way
mArrowImageView.setScaleType(ScaleType.MATRIX);
Matrix matrix = new Matrix();
matrix.setRotate(180f, arrowD.getIntrinsicWidth() / 2f, arrowD.getIntrinsicHeight() / 2f);
mArrowImageView.setImageMatrix(matrix);
break;
default:
case PULL_FROM_START:
inAnimResId = R.anim.slide_in_from_top;
outAnimResId = R.anim.slide_out_to_top;
setBackgroundResource(R.drawable.indicator_bg_top);
break;
}
mInAnim = AnimationUtils.loadAnimation(context, inAnimResId);
mInAnim.setAnimationListener(this);
mOutAnim = AnimationUtils.loadAnimation(context, outAnimResId);
mOutAnim.setAnimationListener(this);
final Interpolator interpolator = new LinearInterpolator();
mRotateAnimation = new RotateAnimation(0, -180, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
mRotateAnimation.setInterpolator(interpolator);
mRotateAnimation.setDuration(DEFAULT_ROTATION_ANIMATION_DURATION);
mRotateAnimation.setFillAfter(true);
mResetRotateAnimation = new RotateAnimation(-180, 0, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mResetRotateAnimation.setInterpolator(interpolator);
mResetRotateAnimation.setDuration(DEFAULT_ROTATION_ANIMATION_DURATION);
mResetRotateAnimation.setFillAfter(true);
}
示例15: getAnimationSetRotation
import android.view.animation.RotateAnimation; //导入方法依赖的package包/类
/**
* 旋转动画
*
* @return
*/
public static AnimationSet getAnimationSetRotation() {
AnimationSet animationSet = new AnimationSet(true);
RotateAnimation rotateAnimation = new RotateAnimation(30, 0, RELATIVE_TO_SELF, 0.5f, RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setDuration(400);
rotateAnimation.setInterpolator(new DecelerateInterpolator());
animationSet.addAnimation(rotateAnimation);
animationSet.setDuration(400);
return animationSet;
}