本文整理匯總了Java中android.view.animation.RotateAnimation.setRepeatMode方法的典型用法代碼示例。如果您正苦於以下問題:Java RotateAnimation.setRepeatMode方法的具體用法?Java RotateAnimation.setRepeatMode怎麽用?Java RotateAnimation.setRepeatMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.view.animation.RotateAnimation
的用法示例。
在下文中一共展示了RotateAnimation.setRepeatMode方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: RotateLoadingLayout
import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
public RotateLoadingLayout(Context context, PullToRefreshBase.Mode mode, PullToRefreshBase.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);
}
示例3: 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);
}
示例4: onLoadingState
import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
/**
* 加載中
*/
@DoMain
public void onLoadingState() {
FrameLayout contains = (FrameLayout) rootView.findViewById(R.id.state_contains);
contains.removeAllViews();
View loading = View.inflate(this.getContext(), R.layout.view_loading, null);
contains.addView(loading);
ImageView loading_img = (ImageView) loading.findViewById(R.id.loading_icon);
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setDuration(500);
rotateAnimation.setRepeatMode(RotateAnimation.RESTART);
rotateAnimation.setRepeatCount(-1);
loading_img.setAnimation(rotateAnimation);
}
示例5: onLoadingState
import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
/**
* 加載中
*/
@DoMain
public void onLoadingState() {
FrameLayout contains = (FrameLayout) findViewById(R.id.state_contains);
contains.removeAllViews();
View loading = View.inflate(this, R.layout.view_loading, null);
contains.addView(loading);
ImageView loading_img = (ImageView) loading.findViewById(R.id.loading_icon);
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setDuration(500);
rotateAnimation.setRepeatMode(RotateAnimation.RESTART);
rotateAnimation.setRepeatCount(-1);
loading_img.setAnimation(rotateAnimation);
}
示例6: 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);
}
示例7: 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;
}
示例8: 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;
}
示例9: startProgress
import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
public void startProgress(){
if (mRefreshButton.getAnimation() != null)
return;
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF,
0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setDuration(500);
rotateAnimation.setFillAfter(false);
rotateAnimation.setRepeatCount(-1);
rotateAnimation.setRepeatMode(Animation.RESTART);
rotateAnimation.setInterpolator(new LinearInterpolator());
mRefreshButton.startAnimation(rotateAnimation);
}
示例10: startRotate
import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
/**
* rotate
*/
private void startRotate() {
RotateAnimation rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
rotate.setDuration(1000);
// rotate.setRepeatMode(Animation.REVERSE);
rotate.setRepeatMode(Animation.RESTART);
rotate.setRepeatCount(Animation.INFINITE);
content.startAnimation(rotate);
}
示例11: 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;
}
示例12: 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;
}