android.animation.AnimatorSet.setInterpolator()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(122)

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

AnimatorSet.setInterpolator介绍

暂无

代码示例

代码示例来源:origin: Clans/FloatingActionButton

/**
 * Sets the {@link android.view.animation.Interpolator} for <b>FloatingActionButton's</b> icon animation.
 *
 * @param interpolator the Interpolator to be used in animation
 */
public void setIconAnimationInterpolator(Interpolator interpolator) {
  mOpenAnimatorSet.setInterpolator(interpolator);
  mCloseAnimatorSet.setInterpolator(interpolator);
}

代码示例来源:origin: Clans/FloatingActionButton

public void setIconAnimationOpenInterpolator(Interpolator openInterpolator) {
  mOpenAnimatorSet.setInterpolator(openInterpolator);
}

代码示例来源:origin: Clans/FloatingActionButton

public void setIconAnimationCloseInterpolator(Interpolator closeInterpolator) {
  mCloseAnimatorSet.setInterpolator(closeInterpolator);
}

代码示例来源:origin: ImmortalZ/TransitionHelper

@Override
public void translate(InfoBean bean, ExposeView parent, View child) {
  set.playTogether(
      ObjectAnimator.ofFloat(child, "scaleY", 1)
  );
  set.setInterpolator(new AccelerateInterpolator());
  set.setDuration(showDuration).start();
}

代码示例来源:origin: ImmortalZ/TransitionHelper

@Override
public void loadPlaceholder(InfoBean bean, ImageView placeholder) {
  AnimatorSet set = new AnimatorSet();
  set.playTogether(
      ObjectAnimator.ofFloat(placeholder, "scaleX", 1, 0),
      ObjectAnimator.ofFloat(placeholder, "scaleY", 1, 0)
  );
  set.setInterpolator(new AccelerateInterpolator());
  set.setDuration(showDuration / 4 * 5).start();
}

代码示例来源:origin: ImmortalZ/TransitionHelper

@Override
public void loadPlaceholder(InfoBean bean, ImageView placeholder) {
  AnimatorSet set = new AnimatorSet();
  set.playTogether(
      ObjectAnimator.ofFloat(placeholder, "rotation", 0, 180),
      ObjectAnimator.ofFloat(placeholder, "scaleX", 1, 0),
      ObjectAnimator.ofFloat(placeholder, "scaleY", 1, 0)
  );
  set.setInterpolator(new AccelerateInterpolator());
  set.setDuration(showDuration / 4 * 5).start();
}

代码示例来源:origin: gzu-liyujiang/AndroidPicker

@Override
protected void showAfter() {
  View rootView = getRootView();
  AnimatorSet animatorSet = new AnimatorSet();
  ObjectAnimator alpha = ObjectAnimator.ofFloat(rootView, "alpha", 0, 1);
  ObjectAnimator translation = ObjectAnimator.ofFloat(rootView, "translationY", 300, 0);
  animatorSet.playTogether(alpha, translation);
  animatorSet.setDuration(1000);
  animatorSet.setInterpolator(new AccelerateInterpolator());
  animatorSet.start();
}

代码示例来源:origin: ImmortalZ/TransitionHelper

@Override
public void translate(InfoBean bean, ExposeView parent, View child) {
  set.playTogether(
      ObjectAnimator.ofFloat(child, "translationX", 0, -bean.translationX),
      ObjectAnimator.ofFloat(child, "translationY", 0, -bean.translationY),
      ObjectAnimator.ofFloat(child, "scaleX", 1,1/bean.scale),
      ObjectAnimator.ofFloat(child, "scaleY", 1,1/bean.scale)
  );
  set.setInterpolator(new AccelerateInterpolator());
  set.setDuration(showDuration).start();
}

代码示例来源:origin: ImmortalZ/TransitionHelper

@Override
public void loadPlaceholder(InfoBean bean, ImageView placeholder) {
  AnimatorSet set = new AnimatorSet();
  set.playTogether(
      ObjectAnimator.ofFloat(placeholder,"rotation",0,180),
      ObjectAnimator.ofFloat(placeholder, "scaleX", 1, 0),
      ObjectAnimator.ofFloat(placeholder, "scaleY", 1, 0)
  );
  set.setInterpolator(new AccelerateInterpolator());
  set.setDuration(showDuration / 4 * 5).start();
}

代码示例来源:origin: ImmortalZ/TransitionHelper

@Override
public void loadPlaceholder(InfoBean bean, ImageView placeholder) {
  AnimatorSet set = new AnimatorSet();
  set.playTogether(
      ObjectAnimator.ofFloat(placeholder, "rotation", 0, 180),
      ObjectAnimator.ofFloat(placeholder, "scaleX", 1, 0),
      ObjectAnimator.ofFloat(placeholder, "scaleY", 1, 0)
  );
  set.setInterpolator(new AccelerateInterpolator());
  set.setDuration(showDuration / 4 * 5).start();
  //placeholder.setVisibility(View.GONE);
}

代码示例来源:origin: ImmortalZ/TransitionHelper

@Override
  public void loadPlaceholder(InfoBean bean, ImageView placeholder) {
    AnimatorSet set = new AnimatorSet();
    set.playTogether(
        ObjectAnimator.ofFloat(placeholder, "rotation", 0, 180),
        ObjectAnimator.ofFloat(placeholder, "scaleX", 1, 0),
        ObjectAnimator.ofFloat(placeholder, "scaleY", 1, 0)
    );
    set.setInterpolator(new AccelerateInterpolator());
    set.setDuration(showDuration / 4 * 5).start();
  }
})

代码示例来源:origin: jeasonlzy/ImagePicker

private void enterAnimator() {
  ObjectAnimator alpha = ObjectAnimator.ofFloat(masker, "alpha", 0, 1);
  ObjectAnimator translationY = ObjectAnimator.ofFloat(listView, "translationY", listView.getHeight(), 0);
  AnimatorSet set = new AnimatorSet();
  set.setDuration(400);
  set.playTogether(alpha, translationY);
  set.setInterpolator(new AccelerateDecelerateInterpolator());
  set.start();
}

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

/**
 * 爱心的显示动画实现
 */
private AnimatorSet getEnterAnimtorSet(View target) {
  //爱心的3中动画组合 透明度 x,y轴的缩放
  ObjectAnimator alpha = ObjectAnimator.ofFloat(target, View.ALPHA, 0.2f, 1f);
  ObjectAnimator scaleX = ObjectAnimator.ofFloat(target, View.SCALE_X, 0.2f, 1f);
  ObjectAnimator scaleY = ObjectAnimator.ofFloat(target, View.SCALE_Y, 0.2f, 1f);
  //组合动画
  AnimatorSet set = new AnimatorSet();
  set.setDuration(500);
  set.setInterpolator(new LinearInterpolator());
  set.playTogether(alpha, scaleX, scaleY);
  set.setTarget(target);
  return set;
}

代码示例来源:origin: ImmortalZ/TransitionHelper

@Override
public void loadPlaceholder(InfoBean bean, ImageView placeholder) {
  AnimatorSet set = new AnimatorSet();
  set.playTogether(
      ObjectAnimator.ofFloat(placeholder, "alpha", 1f, 0f),
      ObjectAnimator.ofFloat(placeholder, "scaleX", 1.5f, 1f),
      ObjectAnimator.ofFloat(placeholder, "scaleY", 1.5f, 1f)
  );
  set.setInterpolator(new AccelerateInterpolator());
  set.addListener(new AnimatorListenerAdapter() {
    @Override
    public void onAnimationCancel(Animator animation) {
      super.onAnimationCancel(animation);
    }
  });
  set.setDuration(showDuration / 4 * 5).start();
}

代码示例来源:origin: lyft/scissors

private void animate(Interpolator interpolator, long duration, ValueAnimator first, ValueAnimator... animators) {
    animator = new AnimatorSet();
    animator.setDuration(duration);
    animator.setInterpolator(interpolator);
    animator.addListener(animatorListener);
    AnimatorSet.Builder builder = animator.play(first);
    for(ValueAnimator valueAnimator : animators) {
      builder.with(valueAnimator);
    }
    animator.start();
  }
}

代码示例来源:origin: dinuscxj/LoadingDrawable

private Animator getAnimator(LeafHolder target, RectF leafFlyRect, float progress) {
  ValueAnimator bezierValueAnimator = getBezierValueAnimator(target, leafFlyRect, progress);
  AnimatorSet finalSet = new AnimatorSet();
  finalSet.playSequentially(bezierValueAnimator);
  finalSet.setInterpolator(INTERPOLATORS[mRandom.nextInt(INTERPOLATORS.length)]);
  finalSet.setTarget(target);
  return finalSet;
}

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

transition.playTogether(changeBounds, corners, color);
transition.setDuration(getDuration());
transition.setInterpolator(interpolator);
return transition;

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

private void changeMenuIconAnimation(final FloatingActionMenu menu) {
 AnimatorSet set=new AnimatorSet();
 final ImageView v=menu.getMenuIconView();
 ObjectAnimator scaleOutX=ObjectAnimator.ofFloat(v, "scaleX", 1.0f, 0.2f);
 ObjectAnimator scaleOutY=ObjectAnimator.ofFloat(v, "scaleY", 1.0f, 0.2f);
 ObjectAnimator scaleInX=ObjectAnimator.ofFloat(v, "scaleX", 0.2f, 1.0f);
 ObjectAnimator scaleInY=ObjectAnimator.ofFloat(v, "scaleY", 0.2f, 1.0f);
 scaleOutX.setDuration(50);
 scaleOutY.setDuration(50);
 scaleInX.setDuration(150);
 scaleInY.setDuration(150);
 scaleInX.addListener(new AnimatorListenerAdapter() {
  @Override
  public void onAnimationStart(Animator animation) {
   v.setImageResource(menu.isOpened()
     ? R.drawable.ic_action_settings
     : R.drawable.ic_close);
  }
 });
 set.play(scaleOutX).with(scaleOutY);
 set.play(scaleInX).with(scaleInY).after(scaleOutX);
 set.setInterpolator(new OvershootInterpolator(2));
 menu.setIconToggleAnimatorSet(set);
}

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

/**
 * 爱心的显示和运行轨迹动画组合实现
 */
private Animator getAnimtor(View target) {
  AnimatorSet enterAnimtorSet = getEnterAnimtorSet(target);
  ValueAnimator bezierAnimtor = getBezierAnimtor(target);
  AnimatorSet animatorSet = new AnimatorSet();
  animatorSet.playSequentially(enterAnimtorSet);
  animatorSet.playSequentially(enterAnimtorSet, bezierAnimtor);
  animatorSet.setInterpolator(interpolators[mRandom.nextInt(4)]);
  animatorSet.setTarget(target);
  return animatorSet;
}

代码示例来源:origin: Clans/FloatingActionButton

private void createCustomAnimation() {
  AnimatorSet set = new AnimatorSet();
  ObjectAnimator scaleOutX = ObjectAnimator.ofFloat(menuGreen.getMenuIconView(), "scaleX", 1.0f, 0.2f);
  ObjectAnimator scaleOutY = ObjectAnimator.ofFloat(menuGreen.getMenuIconView(), "scaleY", 1.0f, 0.2f);
  ObjectAnimator scaleInX = ObjectAnimator.ofFloat(menuGreen.getMenuIconView(), "scaleX", 0.2f, 1.0f);
  ObjectAnimator scaleInY = ObjectAnimator.ofFloat(menuGreen.getMenuIconView(), "scaleY", 0.2f, 1.0f);
  scaleOutX.setDuration(50);
  scaleOutY.setDuration(50);
  scaleInX.setDuration(150);
  scaleInY.setDuration(150);
  scaleInX.addListener(new AnimatorListenerAdapter() {
    @Override
    public void onAnimationStart(Animator animation) {
      menuGreen.getMenuIconView().setImageResource(menuGreen.isOpened()
          ? R.drawable.ic_close : R.drawable.ic_star);
    }
  });
  set.play(scaleOutX).with(scaleOutY);
  set.play(scaleInX).with(scaleInY).after(scaleOutX);
  set.setInterpolator(new OvershootInterpolator(2));
  menuGreen.setIconToggleAnimatorSet(set);
}

相关文章