android.view.ViewPropertyAnimator.rotation()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中android.view.ViewPropertyAnimator.rotation()方法的一些代码示例,展示了ViewPropertyAnimator.rotation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ViewPropertyAnimator.rotation()方法的具体详情如下:
包路径:android.view.ViewPropertyAnimator
类名称:ViewPropertyAnimator
方法名:rotation

ViewPropertyAnimator.rotation介绍

暂无

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public ViewPropertyAnimator rotation(float value) {
  android.view.ViewPropertyAnimator n = mNative.get();
  if (n != null) {
    n.rotation(value);
  }
  return this;
}

代码示例来源:origin: scwang90/SmartRefreshLayout

@Override
public void onStartAnimator(@NonNull RefreshLayout refreshLayout, int height, int maxDragHeight) {
  final View progressView = mProgressView;
  if (progressView.getVisibility() != VISIBLE) {
    progressView.setVisibility(VISIBLE);
    Drawable drawable = mProgressView.getDrawable();
    if (drawable instanceof Animatable) {
      ((Animatable) drawable).start();
    } else {
      progressView.animate().rotation(36000).setDuration(100000);
    }
  }
}

代码示例来源:origin: jdsjlzx/LRecyclerView

public static void closeArrow(View view) {
  view.animate().setDuration(ARROW_ROTATION_DURATION).rotation(0);
}

代码示例来源:origin: jdsjlzx/LRecyclerView

public static void openArrow(View view) {
  view.animate().setDuration(ARROW_ROTATION_DURATION).rotation(90);
}

代码示例来源:origin: scwang90/SmartRefreshLayout

@Override
public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) {
  final View arrowView = mArrowView;
  if (!mNoMoreData) {
    switch (newState) {
      case None:
        arrowView.setVisibility(VISIBLE);
      case PullUpToLoad:
        mTitleText.setText(mTextPulling);
        arrowView.animate().rotation(180);
        break;
      case Loading:
      case LoadReleased:
        arrowView.setVisibility(GONE);
        mTitleText.setText(mTextLoading);
        break;
      case ReleaseToLoad:
        mTitleText.setText(mTextRelease);
        arrowView.animate().rotation(0);
        break;
      case Refreshing:
        mTitleText.setText(mTextRefreshing);
        arrowView.setVisibility(GONE);
        break;
    }
  }
}
//</editor-fold>

代码示例来源:origin: scwang90/SmartRefreshLayout

@Override
public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) {
  switch (newState) {
    case None:
    case PullDownToRefresh:
      mHeaderText.setText("下拉开始刷新");
      mArrowView.setVisibility(VISIBLE);//显示下拉箭头
      mProgressView.setVisibility(GONE);//隐藏动画
      mArrowView.animate().rotation(0);//还原箭头方向
      break;
    case Refreshing:
      mHeaderText.setText("正在刷新");
      mProgressView.setVisibility(VISIBLE);//显示加载动画
      mArrowView.setVisibility(GONE);//隐藏箭头
      break;
    case ReleaseToRefresh:
      mHeaderText.setText("释放立即刷新");
      mArrowView.animate().rotation(180);//显示箭头改为朝上
      break;
  }
}

代码示例来源:origin: scwang90/SmartRefreshLayout

@Override
public int onFinish(@NonNull RefreshLayout refreshLayout, boolean success) {
  final View progressView = mProgressView;
  Drawable drawable = mProgressView.getDrawable();
  if (drawable instanceof Animatable) {
    if (((Animatable) drawable).isRunning()) {
      ((Animatable) drawable).stop();
    }
  } else {
    progressView.animate().rotation(0).setDuration(0);
  }
  progressView.setVisibility(GONE);
  return mFinishDuration;//延迟500毫秒之后再弹回
}

代码示例来源:origin: scwang90/SmartRefreshLayout

mTitleText.setText(mTextPulling);
  arrowView.setVisibility(VISIBLE);
  arrowView.animate().rotation(0);
  break;
case Refreshing:
case ReleaseToRefresh:
  mTitleText.setText(mTextRelease);
  arrowView.animate().rotation(180);
  break;
case ReleaseToTwoLevel:
  mTitleText.setText(mTextSecondary);
  arrowView.animate().rotation(0);
  break;
case Loading:

代码示例来源:origin: TeamNewPipe/NewPipe

public static void animateRotation(final View view, long duration, int targetRotation) {
  if (DEBUG) {
    Log.d(TAG, "animateRotation: duration = [" + duration + "], from " + view.getRotation() + " to → " + targetRotation + " in: " + view);
  }
  view.animate().setListener(null).cancel();
  view.animate().rotation(targetRotation).setDuration(duration).setInterpolator(new FastOutSlowInInterpolator())
      .setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationCancel(Animator animation) {
          view.setRotation(targetRotation);
        }
        @Override
        public void onAnimationEnd(Animator animation) {
          view.setRotation(targetRotation);
        }
      }).start();
}

代码示例来源:origin: seven332/EhViewer

private void showActionFab() {
  if (null != mFabLayout && STATE_NORMAL == mState && !mShowActionFab) {
    mShowActionFab = true;
    View fab = mFabLayout.getPrimaryFab();
    fab.setVisibility(View.VISIBLE);
    fab.setRotation(-45.0f);
    fab.animate().scaleX(1.0f).scaleY(1.0f).rotation(0.0f).setListener(null)
        .setDuration(ANIMATE_TIME).setStartDelay(0L)
        .setInterpolator(AnimationUtils.FAST_SLOW_INTERPOLATOR).start();
  }
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

footViewHolder.mRefreshBtn.setOnClickListener(v -> footViewHolder.mRefreshBtn
    .animate()
    .rotation(360)
    .setInterpolator(new LinearInterpolator())
    .setDuration(1000).start());
footViewHolder.mRecommendRefresh.setOnClickListener(v -> footViewHolder.mRecommendRefresh
    .animate()
    .rotation(360)
    .setInterpolator(new LinearInterpolator())
    .setDuration(1000).start());

代码示例来源:origin: janishar/PlaceHolderView

new DecelerateInterpolator(mSwipeDecor.getSwipeAnimFactor());
ViewPropertyAnimator animatorR = v.animate()
    .rotation(0)
    .setInterpolator(decelerateInterpolator)
    .setDuration(animTime)

代码示例来源:origin: seven332/EhViewer

.scaleX(endScale)
.scaleY(endScale)
.rotation(endRotation)
.setStartDelay(delay ? ANIMATE_TIME : 0L)
.setDuration(ANIMATE_TIME)

代码示例来源:origin: seven332/EhViewer

mSearchFab.animate().scaleX(1.0f).scaleY(1.0f).rotation(0.0f).setListener(null)
    .setDuration(ANIMATE_TIME).setStartDelay(delay)
    .setInterpolator(AnimationUtils.FAST_SLOW_INTERPOLATOR).start();

代码示例来源:origin: seven332/EhViewer

fab.setVisibility(View.VISIBLE);
fab.setRotation(-45.0f);
fab.animate().scaleX(1.0f).scaleY(1.0f).rotation(0.0f).setListener(null)
    .setDuration(ANIMATE_TIME).setStartDelay(delay)
    .setInterpolator(AnimationUtils.FAST_SLOW_INTERPOLATOR).start();

代码示例来源:origin: janishar/PlaceHolderView

new DecelerateInterpolator(mSwipeDecor.getSwipeAnimFactor());
ViewPropertyAnimator animatorR = getLayoutView().animate()
    .rotation(0)
    .setInterpolator(decelerateInterpolator)
    .setDuration(animTime);

代码示例来源:origin: nickbutcher/plaid

.rotation(90f)

代码示例来源:origin: janishar/PlaceHolderView

if(isSwipeIn){
  bindSwipeIn(getResolver());
  animator.rotation(-mSwipeDecor.getSwipeRotationAngle());
}else{
  bindSwipeOut(getResolver());
  transX = -mLayoutView.getWidth();
  animator.rotation(mSwipeDecor.getSwipeRotationAngle());

代码示例来源:origin: com.nineoldandroids/library

@Override
public ViewPropertyAnimator rotation(float value) {
  android.view.ViewPropertyAnimator n = mNative.get();
  if (n != null) {
    n.rotation(value);
  }
  return this;
}

代码示例来源:origin: xiepeijie/SwipeCardView

.x(objectX)
    .y(objectY)
    .rotation(0)
    .start();
scale = getScrollProgress();

相关文章