com.nineoldandroids.view.ViewPropertyAnimator.setInterpolator()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(116)

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

ViewPropertyAnimator.setInterpolator介绍

[英]Sets the interpolator for the underlying animator that animates the requested properties. By default, the animator uses the default interpolator for ValueAnimator. Calling this method will cause the declared object to be used instead.
[中]为为请求的属性设置动画的基础动画师设置插值器。默认情况下,动画师使用ValueAnimator的默认插值器。调用此方法将导致使用声明的对象。

代码示例

代码示例来源:origin: wangdan/AisenWeiBo

/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 */
@Deprecated
public static void liftingFromBottom(View view, float baseRotation, int duration){
  ViewHelper.setRotationX(view, baseRotation);
  ViewHelper.setTranslationY(view, view.getHeight() / 3);
  ViewPropertyAnimator
      .animate(view)
      .setInterpolator(new AccelerateDecelerateInterpolator())
      .setDuration(duration)
      .rotationX(0)
      .translationY(0)
      .start();
}

代码示例来源:origin: wangdan/AisenWeiBo

/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 * @param startDelay start delay before animation begin
 */
@Deprecated
public static void liftingFromBottom(View view, float baseRotation, int duration, int startDelay){
  ViewHelper.setRotationX(view, baseRotation);
  ViewHelper.setTranslationY(view, view.getHeight() / 3);
  ViewPropertyAnimator
      .animate(view)
      .setInterpolator(new AccelerateDecelerateInterpolator())
      .setDuration(duration)
      .setStartDelay(startDelay)
      .rotationX(0)
      .translationY(0)
      .start();
}

代码示例来源:origin: wangdan/AisenWeiBo

/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param fromY initial Y position of view
 * @param duration aniamtion duration
 * @param startDelay start delay before animation begin
 */
@Deprecated
public static void liftingFromBottom(View view, float baseRotation, float fromY, int duration, int startDelay){
  ViewHelper.setRotationX(view, baseRotation);
  ViewHelper.setTranslationY(view, fromY);
  ViewPropertyAnimator
      .animate(view)
      .setInterpolator(new AccelerateDecelerateInterpolator())
      .setDuration(duration)
      .setStartDelay(startDelay)
      .rotationX(0)
      .translationY(0)
      .start();
}

代码示例来源:origin: wangdan/AisenWeiBo

ViewPropertyAnimator.animate(fabBtn).setInterpolator(mInterpolator)
    .setDuration(TRANSLATE_DURATION_MILLIS)
    .translationY(translationY);

代码示例来源:origin: code-mc/loadtoast

private void slideUp(int startDelay){
    mReAttached = false;

    ViewPropertyAnimator.animate(mView).setStartDelay(startDelay).alpha(0f)
        .translationY(-mView.getHeight() + mTranslationY)
        .setInterpolator(new AccelerateInterpolator())
        .setDuration(300)
        .setListener(new AnimatorListenerAdapter() {
          @Override
          public void onAnimationEnd(Animator animation) {
            if(!mReAttached){
              cleanup();
            }
          }
        })
        .start();

    mVisible = false;
  }
}

代码示例来源:origin: code-mc/loadtoast

private void showInternal(){
  mView.show();
  ViewHelper.setTranslationX(mView, (mParentView.getWidth() - mView.getWidth()) / 2);
  ViewHelper.setAlpha(mView, 0f);
  ViewHelper.setTranslationY(mView, -mView.getHeight() + mTranslationY);
  //mView.setVisibility(View.VISIBLE);
  ViewPropertyAnimator.animate(mView).alpha(1f).translationY(25 + mTranslationY)
      .setInterpolator(new DecelerateInterpolator())
      .setListener(null)
      .setDuration(300).setStartDelay(0).start();
  mVisible = true;
}

代码示例来源:origin: Leaking/WeGit

/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 */
public static void liftingFromBottom(View view, float baseRotation, int duration){
  ViewHelper.setRotationX(view, baseRotation);
  ViewHelper.setTranslationY(view, view.getHeight() / 3);
  ViewPropertyAnimator
      .animate(view)
      .setInterpolator(new AccelerateDecelerateInterpolator())
      .setDuration(duration)
      .rotationX(0)
      .translationY(0)
      .start();
}

代码示例来源:origin: Leaking/WeGit

/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 * @param startDelay start delay before animation begin
 */
public static void liftingFromBottom(View view, float baseRotation, int duration, int startDelay){
  ViewHelper.setRotationX(view, baseRotation);
  ViewHelper.setTranslationY(view, view.getHeight() / 3);
  ViewPropertyAnimator
      .animate(view)
      .setInterpolator(new AccelerateDecelerateInterpolator())
      .setDuration(duration)
      .setStartDelay(startDelay)
      .rotationX(0)
      .translationY(0)
      .start();
}

代码示例来源:origin: Leaking/WeGit

/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param fromY initial Y position of view
 * @param duration aniamtion duration
 * @param startDelay start delay before animation begin
 */
public static void liftingFromBottom(View view, float baseRotation, float fromY, int duration, int startDelay){
  ViewHelper.setRotationX(view, baseRotation);
  ViewHelper.setTranslationY(view, fromY);
  ViewPropertyAnimator
      .animate(view)
      .setInterpolator(new AccelerateDecelerateInterpolator())
      .setDuration(duration)
      .setStartDelay(startDelay)
      .rotationX(0)
      .translationY(0)
      .start();
}

代码示例来源:origin: StannyBing/ZXUtils

.setInterpolator(new AccelerateInterpolator())
.scaleX((float) thumbnailWidth / mViewPager.getWidth())
.scaleY((float) thumbnailHeight / mViewPager.getHeight())

代码示例来源:origin: xiangzhihong/zhihu

if (animate) {
  ViewPropertyAnimator.animate(img_float_btn)
      .setInterpolator(mInterpolator).setDuration(800)
      .translationY(translationY);
} else {

代码示例来源:origin: HelloChenJinJun/TestChat

ViewPropertyAnimator.animate(this).setInterpolator(mInterpolator)
    .setDuration(TRANSLATE_DURATION_MILLIS)
    .translationY(translationY);

代码示例来源:origin: Hankkin/TaoSchool

ViewPropertyAnimator.animate(this).setInterpolator(mInterpolator)
    .setDuration(TRANSLATE_DURATION_MILLIS)
    .translationY(translationY);

代码示例来源:origin: StannyBing/ZXUtils

.translationX(0)
.translationY(0)
.setInterpolator(new DecelerateInterpolator());

相关文章