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


Java RotateAnimation.setDuration方法代碼示例

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


在下文中一共展示了RotateAnimation.setDuration方法的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:Dnet3,項目名稱:CustomAndroidOneSheeld,代碼行數:17,代碼來源:RotateLoadingLayout.java

示例2: initView

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
private void initView(Context context) {
	// 初始情況,設置下拉刷新view高度為0
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, 0);
	mContainer = (LinearLayout) LayoutInflater.from(context).inflate(
			R.layout.xlistview_header, null);
	addView(mContainer, lp);
	setGravity(Gravity.BOTTOM);

	mArrowImageView = (ImageView) findViewById(R.id.xlistview_header_arrow);
	mHintTextView = (TextView) findViewById(R.id.xlistview_header_hint_textview);
	mProgressBar = (ProgressBar) findViewById(R.id.xlistview_header_progressbar);

	mRotateUpAnim = new RotateAnimation(0.0f, -180.0f,
			Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
			0.5f);
	mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
	mRotateUpAnim.setFillAfter(true);
	mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,
			Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
			0.5f);
	mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
	mRotateDownAnim.setFillAfter(true);
}
 
開發者ID:SShineTeam,項目名稱:Huochexing12306,代碼行數:25,代碼來源:XListViewHeader.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: 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);
}
 
開發者ID:liupengandroid,項目名稱:ywApplication,代碼行數:18,代碼來源:FlipLoadingLayout.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: initView

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
private void initView() {
	// 初始情況,設置下拉刷新view高度為0
	mContainer = (LinearLayout) LayoutInflater.from(getContext()).inflate(
			R.layout.listview_header, null);
       LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
       lp.setMargins(0, 0, 0, 0);
	this.setLayoutParams(lp);
       this.setPadding(0, 0, 0, 0);

	addView(mContainer, new LayoutParams(LayoutParams.MATCH_PARENT, 0));
	setGravity(Gravity.BOTTOM);

	mArrowImageView = (ImageView)findViewById(R.id.listview_header_arrow);
	mStatusTextView = (TextView)findViewById(R.id.refresh_status_textview);

       //init the progress view
	mProgressBar = (SimpleViewSwitcher)findViewById(R.id.listview_header_progressbar);
       AVLoadingIndicatorView progressView = new  AVLoadingIndicatorView(getContext());
       progressView.setIndicatorColor(0xffB5B5B5);
       progressView.setIndicatorId(ProgressStyle.BallSpinFadeLoader);
       mProgressBar.setView(progressView);


	mRotateUpAnim = new RotateAnimation(0.0f, -180.0f,
			Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
	mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
	mRotateUpAnim.setFillAfter(true);
	mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,
			Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
	mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
	mRotateDownAnim.setFillAfter(true);
	
	mHeaderTimeView = (TextView)findViewById(R.id.last_refresh_time);
	measure(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
	mMeasuredHeight = getMeasuredHeight();
}
 
開發者ID:Mrqinlei,項目名稱:ImitateZHRB,代碼行數:37,代碼來源:ArrowRefreshHeader.java

示例7: 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);
}
 
開發者ID:MCMrARM,項目名稱:revolution-irc,代碼行數:10,代碼來源:ExpandIconStateHelper.java

示例8: BlackboardRotationHeader

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
public BlackboardRotationHeader(Context context,int rotationSrc,int arrowSrc,int logoSrc,boolean isShowText){
    this.context = context;
    this.rotationSrc = rotationSrc;
    this.arrowSrc = arrowSrc;
    this.logoSrc = logoSrc;
    this.isShowText = isShowText;
    mRotateUpAnim = new RotateAnimation(0.0f, -180.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
    mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateUpAnim.setFillAfter(true);
    mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
    mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
    mRotateDownAnim.setFillAfter(true);
}
 
開發者ID:zuoweitan,項目名稱:Hitalk,代碼行數:14,代碼來源:BlackboardRotationHeader.java

示例9: onActivityCreated

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
@Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

//        showLoading();
        showContentView();
        bindingView.llLoading.setVisibility(View.VISIBLE);
        animation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
        animation.setDuration(3000);//設置動畫持續時間
        animation.setInterpolator(new LinearInterpolator());//不停頓
        animation.setRepeatCount(10);
        bindingView.ivLoading.setAnimation(animation);
        animation.startNow();

        maCache = ACache.get(getContext());
        mEverydayModel = new EverydayModel();
        mBannerImages = (ArrayList<String>) maCache.getAsObject(Constants.BANNER_PIC);
        DebugUtil.error("----mBannerImages: " + (mBannerImages == null));
        DebugUtil.error("----mLists: " + (mLists == null));

        mHeaderBinding = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R.layout.header_item_everyday, null, false);
        // 設置本地數據點擊事件等
        initLocalSetting();
        initRecyclerView();

        mIsPrepared = true;
        /**
         * 因為啟動時先走loadData()再走onActivityCreated,
         * 所以此處要額外調用load(),不然最初不會加載內容
         */
        loadData();
    }
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:33,代碼來源:EverydayFragment.java

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

}
 
開發者ID:liupengandroid,項目名稱:ywApplication,代碼行數:53,代碼來源:IndicatorLayout.java

示例11: animateExpand

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
private void animateExpand() {
  RotateAnimation rotate =
      new RotateAnimation(360, 180, RELATIVE_TO_SELF, 0.5f, RELATIVE_TO_SELF, 0.5f);
  rotate.setDuration(300);
  rotate.setFillAfter(true);
  arrow.setAnimation(rotate);
}
 
開發者ID:TuonBondol,項目名稱:AndroidCollapsingRecyclerView,代碼行數:8,代碼來源:GenreViewHolder.java

示例12: buildAnimation

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
protected 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);
}
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:12,代碼來源:PtrClassicDefaultFooter.java

示例13: rotateCButton

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
/**
 * 主按鈕旋轉動畫
 */
private void rotateCButton(View v, float start, float end, int duration) {
    RotateAnimation animation = new RotateAnimation(start, end, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setDuration(duration);
    animation.setFillAfter(true);
    v.startAnimation(animation);
}
 
開發者ID:DingMouRen,項目名稱:AnnularMenuView,代碼行數:10,代碼來源:AnnularMenu.java

示例14: rotate

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
public void rotate(View v, int start, int end) {
    RotateAnimation rotateAnimation = new RotateAnimation(start, end,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
            0.5f);
    rotateAnimation.setFillAfter(true);
    rotateAnimation.setDuration(200);
    v.startAnimation(rotateAnimation);
}
 
開發者ID:tohodog,項目名稱:QSRefreshLayout,代碼行數:9,代碼來源:XMLRefreshView.java

示例15: startAnimation

import android.view.animation.RotateAnimation; //導入方法依賴的package包/類
/**
 * Method to rotate image around its axis.
 * isFillEnabled and fillAfter - to image at that position in which we left it
 */
private void startAnimation(double fromDegrees, double toDegrees, long durationMillis) {
    rotateAnimation = new RotateAnimation((float) fromDegrees, (float) toDegrees,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    rotateAnimation.setDuration(durationMillis);
    rotateAnimation.setFillEnabled(true);
    rotateAnimation.setFillAfter(true);
    startAnimation(rotateAnimation);
}
 
開發者ID:TheMindStudios,項目名稱:CircleControlView,代碼行數:14,代碼來源:CircleControlView.java


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