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

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

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

ViewPropertyAnimator.setUpdateListener介绍

暂无

代码示例

代码示例来源:origin: h6ah4i/android-advancedrecyclerview

@TargetApi(Build.VERSION_CODES.KITKAT)
  public static void clearViewPropertyAnimatorUpdateListener(View view) {
    view.animate().setUpdateListener(null);
  }
}

代码示例来源:origin: kingargyle/adt-leanback-support

public static void setUpdateListener(final View view,
    final ViewPropertyAnimatorUpdateListener listener) {
  view.animate().setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
    @Override
    public void onAnimationUpdate(ValueAnimator valueAnimator) {
      listener.onAnimationUpdate(view);
    }
  });
}

代码示例来源:origin: imallan/JellyRefreshLayout

private void setUpChildViewAnimator() {
  if (mChildView == null) {
    return;
  }
  mChildView.animate().setInterpolator(new DecelerateInterpolator());
  mChildView.animate().setUpdateListener(valueAnimator -> {
    if (mPullToRefreshPullingListener != null) {
      mPullToRefreshPullingListener.onTranslationYChanged(mChildView.getTranslationY());
    }
  });
}

代码示例来源:origin: Omega-R/OmegaRecyclerView

@Override
protected void setupAddAnimation(ViewPropertyAnimator animator, final OmegaExpandableRecyclerView.Adapter.ChildViewHolder holder) {
  animator.setDuration(holder.animationHelper.havePendingRemovals() ? EXPAND_DURATION_LONG : EXPAND_DURATION_SHORT);
  animator.alpha(1f);
  if (holder.animationHelper.upperViewHolder == null) {
    animator.translationY(0f);
  } else {
    animator.setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
      @Override
      public void onAnimationUpdate(ValueAnimator animation) {
        holder.contentView.setTranslationY(holder.animationHelper.upperViewHolder.contentView.getTranslationY());
      }
    });
  }
}

代码示例来源:origin: Omega-R/OmegaRecyclerView

private void reset(ViewPropertyAnimator animator, OmegaExpandableRecyclerView.Adapter.ChildViewHolder holder) {
  animator.setUpdateListener(null);
  animator.setStartDelay(0);
  holder.itemView.setTranslationZ(ExpandableLayoutManager.DEFAULT_CHILD_Z);
  holder.contentView.setTranslationY(0f);
  ((ChildClippingFrameLayout) holder.itemView).invalidateClipping();
}

代码示例来源:origin: laizimo/richeditor

@Override
  public void run() {
    final LinearLayout.LayoutParams layoutParams= (LinearLayout.LayoutParams) luBottomMenu.getLayoutParams();
    luBottomMenu.animate()
        .translationY(0)
        .setListener(new AnimatorListenerAdapter() {
          @Override
          public void onAnimationStart(Animator animation) {
            luBottomMenu.setVisibility(View.VISIBLE);
            luBottomMenu.setAlpha(0);
          }
        })
        .setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
          @Override
          public void onAnimationUpdate(ValueAnimator animation) {
            layoutParams.setMargins(layoutParams.leftMargin, (int) (-luBottomMenu.getTranslationY()),layoutParams.rightMargin,layoutParams.bottomMargin);
            luBottomMenu.requestLayout();
          }
        })
        .setDuration(duration)
        .alpha(1f).start();
  }
});

代码示例来源:origin: wasdennnoch/AndroidN-ify

.alpha(reverse ? 0f : 1f)
.setInterpolator(alphaInterpolator)
.setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
  @Override
  public void onAnimationUpdate(ValueAnimator animation) {

代码示例来源:origin: wasdennnoch/AndroidN-ify

.setUpdateListener(helper.mBackgroundVisibilityUpdater)
    .start();
helper.mFadeInFromDarkAnimator = TimeAnimator.ofFloat(0.0f, 1.0f);

代码示例来源:origin: Omega-R/OmegaRecyclerView

@Override
protected void setupRemoveAnimation(ViewPropertyAnimator animator, final OmegaExpandableRecyclerView.Adapter.ChildViewHolder holder) {
  animator.setStartDelay(COLLAPSE_DELAY);
  long duration = holder.animationHelper.havePendingAdditions() ? COLLAPSE_DURATION_LONG : COLLAPSE_DURATION_SHORT;
  animator.setDuration(duration);
  if (holder.animationHelper.lowerViewHolder == null) {
    animator.translationY(getHiddenOffset(holder));
  } else {
    animator.setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
      @Override
      public void onAnimationUpdate(ValueAnimator animation) {
        holder.contentView.setTranslationY(holder.animationHelper.lowerViewHolder.contentView.getTranslationY());
      }
    });
  }
  if (holder.animationHelper.havePendingAdditions()) {
    float deltaHeight = 0f;
    for (RecyclerView.ViewHolder viewHolder : holder.animationHelper.getPendingChanges().additions) {
      if (viewHolder.getAdapterPosition() < holder.animationHelper.visibleAdapterPosition) {
        deltaHeight += viewHolder.itemView.getHeight();
      }
    }
    if (deltaHeight > 0) {
      ((ChildClippingFrameLayout) holder.itemView).animateClipAboveDecreasing(deltaHeight, duration, COLLAPSE_DELAY);
    }
  }
}

代码示例来源:origin: laizimo/richeditor

.setDuration(TRANSLATE_DURATION_MILLIS)
.translationY(translationY)
.setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
  @Override
  public void onAnimationUpdate(ValueAnimator animation) {

代码示例来源:origin: sangxiaonian/AliBehaver

finalView.animate().setDuration(500).x(targtX).y(targtY).setInterpolator(interpolator).setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
  @Override
  public void onAnimationUpdate(ValueAnimator animation) {

代码示例来源:origin: yuyuyu123/SwipeCardsRecyclerView

animator.setInterpolator(interpolator);
animator.setListener(getAnimatorListener(animView));
animator.setUpdateListener(getAnimatorUpdateListener(animView));

相关文章