當前位置: 首頁>>代碼示例>>Java>>正文


Java RotateAnimation.setRepeatCount方法代碼示例

本文整理匯總了Java中android.view.animation.RotateAnimation.setRepeatCount方法的典型用法代碼示例。如果您正苦於以下問題:Java RotateAnimation.setRepeatCount方法的具體用法?Java RotateAnimation.setRepeatCount怎麽用?Java RotateAnimation.setRepeatCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.animation.RotateAnimation的用法示例。


在下文中一共展示了RotateAnimation.setRepeatCount方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
 
開發者ID:ccfish86,項目名稱:sctalk,代碼行數:17,代碼來源:RotateLoadingLayout.java

示例2: 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);
}
 
開發者ID:fengdongfei,項目名稱:CXJPadProject,代碼行數:15,代碼來源:AnimationUtil.java

示例3: startLoadingAnimation

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
private void startLoadingAnimation(ImageView imageView) {
  RotateAnimation loadingAnimation =
      new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
          0.5f);
  loadingAnimation.setDuration(1000);
  loadingAnimation.setRepeatCount(-1);
  loadingAnimation.setInterpolator(new LinearInterpolator());
  imageView.setAnimation(loadingAnimation);
  loadingAnimation.start();
}
 
開發者ID:Lingzh0ng,項目名稱:BrotherWeather,代碼行數:11,代碼來源:CustomRefreshLayout2.java

示例4: onCreate

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
@Override protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.progress_dialog);
  getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  ivProgress = (ImageView) findViewById(R.id.ivProgress);
  //tvMessage = (TextView) findViewById(R.id.tvProgressMsg);
  //if (!StringUtil.isEmpty(message)) {
  //  tvMessage.setVisibility(View.VISIBLE);
  //  tvMessage.setText(this.message);
  //} else {
  //  tvMessage.setVisibility(View.GONE);
  //}
  animation =
      new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
          0.5f);
  animation.setInterpolator(new LinearInterpolator());
  animation.setRepeatCount(Animation.INFINITE);
  animation.setDuration(500);
}
 
開發者ID:Lingzh0ng,項目名稱:BrotherWeather,代碼行數:20,代碼來源:BPProgressDialog.java

示例5: 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);
}
 
開發者ID:excitedhaha,項目名稱:RefreshLoadLayout,代碼行數:18,代碼來源:DefaultRefreshIndicator.java

示例6: startLoadingAnimation

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
private void startLoadingAnimation(ImageView imageView) {

    RotateAnimation loadingAnimation =
        new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    loadingAnimation.setDuration(1000);
    loadingAnimation.setRepeatCount(-1);
    loadingAnimation.setInterpolator(new LinearInterpolator());
    imageView.setAnimation(loadingAnimation);
    loadingAnimation.start();
  }
 
開發者ID:Lingzh0ng,項目名稱:ITSM,代碼行數:12,代碼來源:ReleaseStatusRecyclerViewAdapter.java

示例7: 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);
}
 
開發者ID:penghongru,項目名稱:Coder,代碼行數:17,代碼來源:StateFragment.java

示例8: onCreate

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	ButterKnife.bind(this);

	sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);
	editor = sharedPreferences.edit();

	an = new RotateAnimation(0.0f,
			360.0f,Animation.RELATIVE_TO_SELF, 0.5f,
			Animation.RELATIVE_TO_SELF,
			0.5f);

	// Set the animation's parameters
	an.setInterpolator(new LinearInterpolator());
	an.setDuration(7000);               // duration in ms
	an.setRepeatCount(-1);                // -1 = infinite repeated
}
 
開發者ID:egineering-llc,項目名稱:secretknock,代碼行數:20,代碼來源:MainActivity.java

示例9: 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);
    }
 
開發者ID:wuhighway,項目名稱:DailyStudy,代碼行數:12,代碼來源:AnimationDemoActivity.java

示例10: 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;
}
 
開發者ID:isuhao,項目名稱:QMark,代碼行數:10,代碼來源:WelcomeSnowActy.java

示例11: initPaint

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
private void initPaint() {
    mStrokeWidth = dip2px(2);
    mPadding = dip2px(2);
    mProRadius = getMeasuredHeight() / 5;


    mProgerssButtonAnim = new ProgerssButtonAnim();
    mProgerssRotateAnim = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF,
            0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    mProgerssRotateAnim.setRepeatCount(-1);
    mProgerssRotateAnim.setInterpolator(new LinearInterpolator());//不停頓
    mProgerssRotateAnim.setFillAfter(true);//停在最後
    paintRectF = new Paint();
    paintRectF.setAntiAlias(true);
    paintRectF.setStyle(Paint.Style.FILL);
    paintRectF.setStrokeWidth(mStrokeWidth);

    paintText = new Paint();
    paintText.setAntiAlias(true);
    paintText.setStyle(Paint.Style.FILL);
    paintText.setTextSize(dip2px(15));
    paintPro = new Paint();
    paintPro.setAntiAlias(true);
    paintPro.setStyle(Paint.Style.STROKE);
    paintPro.setStrokeWidth(mStrokeWidth / 2);

}
 
開發者ID:li-yu,項目名稱:Huahui-Android,代碼行數:28,代碼來源:ProgressButton.java

示例12: 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;
}
 
開發者ID:Muddz,項目名稱:StyleableToast,代碼行數:11,代碼來源:StyleableToast.java

示例13: rotationAnim

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
/**
 * Rotate ImageView
 *
 * @param view
 */
public static void rotationAnim(@NonNull View view) {
    RotateAnimation rotateAnimation1 = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation1.setInterpolator(new LinearInterpolator());
    rotateAnimation1.setDuration(300);
    rotateAnimation1.setRepeatCount(0);
    view.startAnimation(rotateAnimation1);
}
 
開發者ID:RajneeshSingh007,項目名稱:MusicX-music-player,代碼行數:14,代碼來源:Helper.java

示例14: 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;
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:14,代碼來源:AnimUtil.java

示例15: 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);

}
 
開發者ID:zuoweitan,項目名稱:Hitalk,代碼行數:12,代碼來源:AddressRotationHeader.java


注:本文中的android.view.animation.RotateAnimation.setRepeatCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。